469,927 Members | 1,717 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

Send Email

Hi Guys,

I'm using this code to send an email with attachment but it's not working !!
So, what I'm missing!!? knowing that both From & To email addresses are
correct?

MailMessage msgMail = new MailMessage();
msgMail.To = "ba*********@yahoo.com";
msgMail.From = "ba****@bigpond.com";
msgMail.Subject = "Attachment Test";
msgMail.BodyFormat = MailFormat.Text;
msgMail.Body = "Check out the attachment!";
msgMail.Attachments.Add(new MailAttachment("c:\\report.pdf"));
SmtpMail.Send(msgMail);
Response.Write("Email was queued to disk");
Thanks
--
Regards,
M.Rochdi

Aug 13 '07 #1
2 1376
On Aug 13, 3:40 pm, Mike <M...@discussions.microsoft.comwrote:
Hi Guys,

I'm using this code to send an email with attachment but it's not working !!
So, what I'm missing!!? knowing that both From & To email addresses are
correct?

MailMessage msgMail = new MailMessage();
msgMail.To = "badisroc...@yahoo.com";
msgMail.From = "bad...@bigpond.com";
msgMail.Subject = "Attachment Test";
msgMail.BodyFormat = MailFormat.Text;
msgMail.Body = "Check out the attachment!";
msgMail.Attachments.Add(new MailAttachment("c:\\report.pdf"));
SmtpMail.Send(msgMail);
Response.Write("Email was queued to disk");

Thanks
--
Regards,
M.Rochdi
is this working without attachment?

Aug 13 '07 #2
Are your SMTP Server settings correct?

On Aug 13, 9:40 am, Mike <M...@discussions.microsoft.comwrote:
Hi Guys,

I'm using this code to send an email with attachment but it's not working !!
So, what I'm missing!!? knowing that both From & To email addresses are
correct?

MailMessage msgMail = new MailMessage();
msgMail.To = "badisroc...@yahoo.com";
msgMail.From = "bad...@bigpond.com";
msgMail.Subject = "Attachment Test";
msgMail.BodyFormat = MailFormat.Text;
msgMail.Body = "Check out the attachment!";
msgMail.Attachments.Add(new MailAttachment("c:\\report.pdf"));
SmtpMail.Send(msgMail);
Response.Write("Email was queued to disk");

Thanks
--
Regards,
M.Rochdi

Aug 13 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Google Mike | last post: by
40 posts views Thread by ian | last post: by
reply views Thread by David Burson | last post: by
9 posts views Thread by Bob Jones | last post: by
8 posts views Thread by shapper | last post: by
9 posts views Thread by Mahernoz | last post: by
2 posts views Thread by Malli mindwave | last post: by
5 posts views Thread by Mike | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.