I am trying to use the following code to let users of my program send emails to an email address without having to use their email program.
Can anyone see whats wrong? I am thinking I may be using the wrong smtp address, maybe its in the wrong format.
Visual Basic:
Dim subjectLine As String
Dim emailToSend As New System.Web.Mail.MailMessage
Dim messageBody As String
'CREATE MESSAGE BODY
Try
messageBody = TextBox3.Text
'CREATE MESSAGE HEADER
subjectLine = "Submitted Information"
emailToSend.From = "RSSK"
emailToSend.To = "rs_sidekick@msn.com"
emailToSend.Body = messageBody.ToString
emailToSend.Subject = subjectLine
System.Web.Mail.SmtpMail.SmtpServer = "smtp.charter.net"
System.Web.Mail.SmtpMail.Send(emailToSend)
Catch ex As Exception
Throw ex
End Try
emailToSend = Nothing
Can anyone see whats wrong? I am thinking I may be using the wrong smtp address, maybe its in the wrong format.