|
-
May 5th, 2011, 03:31 PM
#1
Thread Starter
New Member
SMTP Exception - Message could not be sent
Hello everyone,
I'm creating an application for my own use that allows me to notify my lawnmowing customers when their grass was last cut, how much they owe, etc.
The application uses an SMTP client to send a MailMessage to the customers through my Yahoo! online email account. The code for sending the message is as follows:
Code:
Dim notification As New MailMessage
notification.Subject = "Grass Tracker Notification"
notification.To.Add("[email protected]")
notification.From("[email protected]")
notification.Body(emailbodystringcreatedearlier)
Dim Smtp As New SMTPClient()
Smtp.Host = "smtp.mail.yahoo.com"
Smtp.Port = "995"
Smtp.Credentials = New System.Net.Credentials("username", "password)
Smtp.EnableSsl = True
Smtp.Send(notification)
However, every time I try to send the message I get an error message that says "Smtp Exception" and "Message could not be sent" or something of that sort. I have tried the following to remedy the problem:
- Using different ports and clients found online
- Using a "Try...Catch" method to handle the exception. Every time I attempt to send the message the exception is thrown
Can anyone offer some advice on how to fix this? The exception is rather vague and doesn't offer a whole lot on what needs changed, like an improper port or something.
All advice is appreciated and Thanks,
Josh
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|