Sending email from within a web service

J

Joe

I have a method which sends email to & from a specific account. All was
working fine until the server was upgraded to an AD/DNS server. Now the
email never goes through.

I can run the same code from an exe and it works fine.

MailMessage mail = new MailMessage();

mail.Body = msg;
mail.From = emailfrom;
mail.To = emailto;
mail.Subject = "Test.";
mail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"]
= 2;
mail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserver"]
= "mail.mydomain.com";
mail.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserverport"]
= 25;
mail.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"]
= "(e-mail address removed)";
mail.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"]
= "******";

SmtpMail.SmtpServer = "mail.mydomain.com";
SmtpMail.Send(mail);

Does the service need to be granted a certain permission?
 
J

Joe

The problem doesn't seem to be related to sending the email but calling the
web service. I'm getting a timed-out exception.

I'll repost with this problem.
 

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

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top