StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Sending EmailExpand / Collapse
Author
Message
Posted 09/18/2007 3:47:24 PM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 09/17/2008 4:07:53 PM
Posts: 148, Visits: 524
I am planning to allow users to send mail messages via my application and was wondering what you use?
Post #11557
Posted 09/18/2007 10:22:25 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Today @ 6:27:30 PM
Posts: 1,268, Visits: 3,233
.NET has classes to do this internally. See the System.Net.Mail namespace and this article

http://www.systemnetmail.com/default.aspx

This works fine if your users are on your network and they will use your smtp server to do the sending. However, in my case, many of my users are remote and the only way is to configure the system to use THEIR smtp servers (whaterver that might be).

Post #11565
Posted 09/19/2007 8:55:44 AM


Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: StrataFrame Users
Last Login: Today @ 8:41:13 PM
Posts: 646, Visits: 21,889
something like this perhaps

Dim mail As New MailMessage()
Dim smtp As New SmtpClient(Me.txtSMTPServer.Text)

' form the email, catch errors and report
Try
mail.IsBodyHtml = True

'set the addresses
mail.From = New MailAddress("SDSILogtool@sigmadatainc.com", "SDSI Logtool Utility")
mail.To.Add(Me.txtEmailAddress.Text)

'set the content
mail.Subject = "Backup Report - " & Me.txtCompanyName.Text & " " & Me.txtCurrentLogDate.Text
mail.Body = emailbody

'to authenticate we set the username and password properites on the SmtpClient
smtp.Credentials = New Net.NetworkCredential(Me.txtSMTPUsername.Text, Me.txtSMPTPassword.Text)
Catch ex As System.Exception
MsgBox("Error forming email. " & ex.Message.ToString)
End Try

'send, catch errors and report
Try
smtp.Send(mail)
Catch ex As System.Exception
MsgBox("Error sending email, check SMTP settings, or contact your administrator." & ex.Message.ToString)
End Try
Post #11569
Posted 09/19/2007 9:00:28 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 09/26/2008 8:30:36 AM
Posts: 2,685, Visits: 1,886
Good job, guys.  Don't forget that you can also make the body of an email HTML by setting the IsBodyHtml property after you set the Body property on the message.  It allows you to include formatting and such.


www.bungie.net
Post #11572
Posted 09/19/2007 11:15:51 AM


StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: 09/17/2008 4:07:53 PM
Posts: 148, Visits: 524
Ok thanks,

I was looking at the Email Factory for .Net which is about $299

Post #11585
Posted 09/19/2007 12:54:15 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 09/26/2008 8:30:36 AM
Posts: 2,685, Visits: 1,886
Nah, for just email, you can use the .NET classes.  However, I think that email factory was designed for .NET 1.0/1.1, which I don't think had near as many things in the System.Net namespace.  The mail implementation is much more robust in .NET 2.0.

But, there is certainly a market for networking related .NET tools.  You might also try http://www.nsoftware.com/.  They have the IPWorks suite, which contains lots of stuff for HTTP servers, socket communications, and tons of other stuff.


www.bungie.net
Post #11592
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 8:44pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.125. 11 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.