Sending email from within a web service

Discussion in 'ASP .Net Web Services' started by Joe, Sep 27, 2005.

  1. Joe

    Joe Guest

    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"]
    = "";
    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?
     
    Joe, Sep 27, 2005
    #1
    1. Advertising

  2. Joe

    Joe Guest

    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.

    "Joe" <J_no_spam@_no_spam_Fishinbrain.com> wrote in message
    news:...
    >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"]
    > = "";
    >
    > 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?
    >
    >
    >
     
    Joe, Sep 27, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hocho888
    Replies:
    1
    Views:
    660
  2. Luke
    Replies:
    2
    Views:
    4,753
    Nigel Wade
    Mar 15, 2007
  3. Tony T.

    Calling an Asynch web service within a web service.

    Tony T., Apr 26, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    198
    Tony T.
    Apr 26, 2004
  4. Mike Dearman
    Replies:
    1
    Views:
    200
    Mike Dearman
    Jun 23, 2004
  5. Ghislain Tanguay

    Example of a web service sending email with attachments

    Ghislain Tanguay, Aug 2, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    130
    Ghislain Tanguay
    Aug 2, 2004
Loading...

Share This Page