(sorry for the dual post here and the webservice NG. I meant to send to both
at the same time)

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"]
= "sender@mydomain.com";
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?

Re: Sending email from within a WebService by Joe

Joe
Tue Sep 27 15:03:29 CDT 2005

Sorry - wrong group :)

"Joe" <J_no_spam@_no_spam_Fishinbrain.com> wrote in message
news:Oq7Tp45wFHA.3252@TK2MSFTNGP10.phx.gbl...
> (sorry for the dual post here and the webservice NG. I meant to send to
> both at the same time)
>
> 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"]
> = "sender@mydomain.com";
>
> 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?
>
>
>
>



Re: Sending email from within a WebService by Sahil

Sahil
Wed Oct 05 23:25:07 CDT 2005

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

Not necessarily !! As long as nothing on your server prevents the userid
running the service from connecting to the SMTP server, you don't need
anything special.


--

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
----------------------------------------------------------------------------



"Joe" <J_no_spam@_no_spam_Fishinbrain.com> wrote in message
news:Oq7Tp45wFHA.3252@TK2MSFTNGP10.phx.gbl...
> (sorry for the dual post here and the webservice NG. I meant to send to
> both at the same time)
>
> 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"]
> = "sender@mydomain.com";
>
> 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?
>
>
>
>