Send Email

G

Guest

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 = "(e-mail address removed)";
msgMail.From = "(e-mail address removed)";
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
 
G

Guest

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 = "(e-mail address removed)";
msgMail.From = "(e-mail address removed)";
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

is this working without attachment?
 
G

Guest

Hello,

First of all let's check if it's a problem of server/client configuration,
or if it's .net code problem.

Try to send an e-mail using the command line:


http://blog.avanadeadvisor.com/blogs/braulio_malaga/archive/2007/02/26/876.aspx

Now, check if there are some security restrictions (E.g., authentication,
or some times the "from" must have some well know domain name). Check as well
if you SMTP server accepts calls from client computers (some time is just
configured to work locally, it doesn't accept petitions from other computers
to avoid spam).

A good support material:

.net fx 2.0
http://www.systemnetmail.com/

.net fx 1.1
http://www.systemwebmail.com/

Good luck
Braulio


/// ------------------------------
/// Braulio Diez
///
/// http://www.tipsdotnet.com
/// ------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top