T
Tull Clancey
Hi all.
Having spent some time trying to get .net 2003 to send emails I'm now
struggling with the 2005 version of smpt.
Microsoft seem to have changed their view on the smtp side of things, before
they gave a single error message for absolutely everything, now I'm getting
no error message, but nothing gets sent!
Can anyone tell me why the following isn't doing anything? I get my final
message box, but no mail is sent!
Thanks,
Tull.
Dim fromAddress As New MailAddress([email protected], "Info")
Dim toAddress As New MailAddress([email protected], "Tull")
Dim msg As New MailMessage(fromAddress, toAddress)
msg.Body = "This is a test of a mail message from VB Net 2005!"
msg.Subject = "Testing new email, sent at " &
DateTime.Now.ToString()
msg.IsBodyHtml = True
Dim mailSender As New System.Net.Mail.SmtpClient()
mailSender.Host = "smtp.myserver.co.uk"
Try
mailSender.Send(msg)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
MsgBox("Mail sent")
Having spent some time trying to get .net 2003 to send emails I'm now
struggling with the 2005 version of smpt.
Microsoft seem to have changed their view on the smtp side of things, before
they gave a single error message for absolutely everything, now I'm getting
no error message, but nothing gets sent!
Can anyone tell me why the following isn't doing anything? I get my final
message box, but no mail is sent!
Thanks,
Tull.
Dim fromAddress As New MailAddress([email protected], "Info")
Dim toAddress As New MailAddress([email protected], "Tull")
Dim msg As New MailMessage(fromAddress, toAddress)
msg.Body = "This is a test of a mail message from VB Net 2005!"
msg.Subject = "Testing new email, sent at " &
DateTime.Now.ToString()
msg.IsBodyHtml = True
Dim mailSender As New System.Net.Mail.SmtpClient()
mailSender.Host = "smtp.myserver.co.uk"
Try
mailSender.Send(msg)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
MsgBox("Mail sent")