| | | 
StrataFrame 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? |
| | | | StrataFrame 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).
|
| | | | 
Advanced 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 |
| | | | 
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 |
| | | | 
StrataFrame 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 |
| | | | 
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 |
| |
|
|