I'm trying to switch from asp and aspmail to system.net.mail to send emails. I download the code and set it up on my application. I don't receive an error message, but I also don't receive an email. I am using the same mail server that I used in asp with
aspmail, but I have been unsuccessful in send an email with system.net.mail referencing that mail server. Is there a log file I can set up to check for an error, or some other place to determine why mail isn't sent with system.net?
Just not working on my work email address w/outlook. I bcc my hotmail account and I received an email, must be an internal issue blocking the emails, although I usually receive some type of message indicating that my email account has been used by another
server.
How do you change the name of a file attachment. My attachment is sent, but with the full path name, is there a way to rename it so the receiver doesn't get the path name?
[quote user="Ez416"]is there a way to know whether the mail sent by will notify the sender that his mail was not succesfully sent?...just like in yahoo (mailer daimon)
StrongTypes
All-Star
30801 Points
6013 Posts
ASPInsiders
Re: HOW TO: Send email using System.Net.Mail
Sep 07, 2006 12:08 PM|LINK
[quote user="Ez416"]This code is working(within our office email), but my problem is I cant send send my email to any yahoo or hotmail addresses
What exception do you get when you try to send the email?
Ryan
MaryFRC
Member
20 Points
11 Posts
Re: HOW TO: Send email using System.Net.Mail
Sep 12, 2006 11:18 PM|LINK
Hi ,
I'm trying to switch from asp and aspmail to system.net.mail to send emails. I download the code and set it up on my application. I don't receive an error message, but I also don't receive an email. I am using the same mail server that I used in asp with aspmail, but I have been unsuccessful in send an email with system.net.mail referencing that mail server. Is there a log file I can set up to check for an error, or some other place to determine why mail isn't sent with system.net?
MaryFRC
Member
20 Points
11 Posts
Re: HOW TO: Send email using System.Net.Mail
Sep 12, 2006 11:24 PM|LINK
Just not working on my work email address w/outlook. I bcc my hotmail account and I received an email, must be an internal issue blocking the emails, although I usually receive some type of message indicating that my email account has been used by another server.
MaryFRC
Member
20 Points
11 Posts
Re: HOW TO: Send email using System.Net.Mail
Sep 13, 2006 08:16 PM|LINK
Hello,
How do you change the name of a file attachment. My attachment is sent, but with the full path name, is there a way to rename it so the receiver doesn't get the path name?
Mary
Ez416
Participant
1088 Points
607 Posts
Re: HOW TO: Send email using System.Net.Mail
Sep 18, 2006 11:34 PM|LINK
StrongTypes
All-Star
30801 Points
6013 Posts
ASPInsiders
Re: HOW TO: Send email using System.Net.Mail
Sep 18, 2006 11:49 PM|LINK
[quote user="Ez416"]is there a way to know whether the mail sent by will notify the sender that his mail was not succesfully sent?...just like in yahoo (mailer daimon)
Yes. See the DeliveryNotificationOptions enum.
Ez416
Participant
1088 Points
607 Posts
Re: HOW TO: Send email using System.Net.Mail
Sep 19, 2006 02:17 AM|LINK
This is my code when i am sending an email
Dim SmtpClient As New System.Net.Mail.SmtpClient 'sample host & port SmtpClient.Host = "10.33.3.3" SmtpClient.Port = 12 SmtpClient.Send("From@test.com", "To@test.com", "Sample Title", "Sample Body")my question is, where am i going to put the code if the sent mailed failed to be delivered?StrongTypes
All-Star
30801 Points
6013 Posts
ASPInsiders
Re: HOW TO: Send email using System.Net.Mail
Sep 19, 2006 02:25 AM|LINK
This is my code when i am sending an email
Dim SmtpClient As New System.Net.Mail.SmtpClient 'sample host & port SmtpClient.Host = "10.33.3.3" SmtpClient.Port = 12 SmtpClient.Send("From@test.com", "To@test.com", "Sample Title", "Sample Body")my question is, where am i going to put the code if the sent mailed failed to be delivered?
Example:
MailMessage mailMessage = new MailMessage();
mailMessage.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
Ez416
Participant
1088 Points
607 Posts
Re: HOW TO: Send email using System.Net.Mail
Sep 19, 2006 03:01 AM|LINK
StrongTypes
All-Star
30801 Points
6013 Posts
ASPInsiders
Re: HOW TO: Send email using System.Net.Mail
Sep 19, 2006 03:05 AM|LINK
[quote user="Ez416"]what is the equivalent code if you convert it to vbscript?
Dim mailMessage As New MailMessage
mailMessage.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure