|
#1
|
|||
|
|||
|
Help with send email
Could someone PLEASE tell me what is wrong here? I’m trying to get my windows application to send an email by pressing a button on the form, but I keep getting this ex.message of “Failure Sending Mail”. I do not get any other error messages. This error occurs at line “obj.Send(Mailmsg)”. I'm using VB2008 Express.
Thanks for any help. ![]() Dim obj As System.Net.Mail.SmtpClient = New System.Net.Mail.SmtpClient Dim Mailmsg As New System.Net.Mail.MailMessage Mailmsg.To.Clear() Mailmsg.To.Add(New System.Net.Mail.MailAddress(SendingEmailTo)) Mailmsg.From = New System.Net.Mail.MailAddress(EmailFrom) Mailmsg.Subject = EmailSubject Try Mailmsg.Body = EmailMessage obj.Host = "smtp.SomeServer.com" obj.Send(Mailmsg) Catch ex As Exception MsgBox("Error Sending The Email For The Following Reason" + Chr(13) + Chr(13) + ex.Message) Exit Sub End Try MsgBox("Message Sent") |
|
#2
|
||||
|
||||
|
__________________
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section. ![]() Please use [Code]your code goes in here[/Code] tags when posting code. Before posting your question, did you look here? Got a question on Linux? Visit our Linux sister site. Modifications Required For VB6 Apps To Work On Vista ![]() Microsoft MVP 2005/2006/2007/2008/2009 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to send email - using vb.net - please help. | yasinirshad | ASP.NET | 2 | 08-10-2007 04:12 AM |
| Email will not send my visual studio 2003 project | kenn_rosie | .NET | 1 | 02-22-2006 09:46 PM |
| Send HTML formatted email | Ed Teune | Enterprise | 0 | 05-15-2002 06:26 PM |
| Generated page from XMLHTTP Request is not used by Save As and Send Page by Email | Phong Tran | Web | 0 | 01-23-2001 08:55 PM |
| Generated page from XMLHTTP Request is not used by Save As and Send Page by Email | Phong Tran | XML | 0 | 01-22-2001 04:59 PM |