Top DevX Stories
Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Search the forums:

Go Back   DevX.com Forums > DevX Developer Forums > .NET

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 11-02-2009, 05:32 PM
JohnSmith40272 JohnSmith40272 is offline
Registered User
 
Join Date: Feb 2008
Posts: 36
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")
Reply With Quote
  #2  
Old 11-03-2009, 08:47 AM
Hack's Avatar
Hack Hack is offline
Super Moderator
 
Join Date: Apr 2007
Location: Sterling Heights, Michigan
Posts: 7,719
http://msdn.microsoft.com/en-us/libr...mtpclient.aspx
__________________
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
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT -4. The time now is 11:56 PM.


Sponsored Links



Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.