Problems sending email

Discussion in 'Microsoft ASP .NET' started by Srinivas, Apr 26, 2005.

  1. Srinivas

    Srinivas Guest

    Hi,

    I am using ASP.NET SmtpMail to send email using the following code

    public void SendEmail(string From, string To, string Subject, StringBuilder
    Message, string Attachment, string mailFormat)
    {
    MailMessage mailMessage = new MailMessage ();
    mailMessage.From = From;
    mailMessage.To = To;
    mailMessage.Subject = Subject;
    mailMessage.Body = Message.ToString ();

    if(mailFormat == "T")
    {
    mailMessage.BodyFormat = MailFormat.Text;
    }
    else if(mailFormat == "H")
    {
    mailMessage.BodyFormat = MailFormat.Html;
    }

    SmtpMail.SmtpServer = "10.0.0.1";
    SmtpMail.Send (mailMessage);
    }

    This code executes fine without error. But the email goes and sits in the
    "C:\Inetpub\mailroot\Queue" folder.
    SMTP service is running and cdosys.dll and cdonts.dll are installed.

    My computer is connected to the internet through a Speedtouch 545 ADSL
    router. I got the "10.0.0.1" by doing the ipconfig at command prompt.

    Can anyone please guide me in the right direction.

    Thanks,

    Srinivas
     
    Srinivas, Apr 26, 2005
    #1
    1. Advertisements

  2. Not sure if this is applicable

    But we had a really odd problem on Windows 2003 Server and sending
    mail through our mail server. If our messages had \n instead of \r\n for
    end of line, then the mail server just wouldn't send the message.

    Very odd. I tested this on several other Windows 2003 Servers and
    couldn't duplicate the issue. So, we ended up just changing our code
    because Microsoft technical support couldn't provide any assistance.

    They were just as baffled.

    --
    2005 Microsoft MVP C#
    Robbe Morris
    http://www.robbemorris.com
    http://www.masterado.net/home/listings.aspx



    "Srinivas" <> wrote in message
    news:%...
    > Hi,
    >
    > I am using ASP.NET SmtpMail to send email using the following code
    >
    > public void SendEmail(string From, string To, string Subject,
    > StringBuilder
    > Message, string Attachment, string mailFormat)
    > {
    > MailMessage mailMessage = new MailMessage ();
    > mailMessage.From = From;
    > mailMessage.To = To;
    > mailMessage.Subject = Subject;
    > mailMessage.Body = Message.ToString ();
    >
    > if(mailFormat == "T")
    > {
    > mailMessage.BodyFormat = MailFormat.Text;
    > }
    > else if(mailFormat == "H")
    > {
    > mailMessage.BodyFormat = MailFormat.Html;
    > }
    >
    > SmtpMail.SmtpServer = "10.0.0.1";
    > SmtpMail.Send (mailMessage);
    > }
    >
    > This code executes fine without error. But the email goes and sits in the
    > "C:\Inetpub\mailroot\Queue" folder.
    > SMTP service is running and cdosys.dll and cdonts.dll are installed.
    >
    > My computer is connected to the internet through a Speedtouch 545 ADSL
    > router. I got the "10.0.0.1" by doing the ipconfig at command prompt.
    >
    > Can anyone please guide me in the right direction.
    >
    > Thanks,
    >
    > Srinivas
    >
    >
    >
     
    Robbe Morris [C# MVP], Apr 26, 2005
    #2
    1. Advertisements

  3. Srinivas

    Scott Allen Guest

    Hi srinivas:

    Are there any informational or error messages from the SMTP service in
    the event log?

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    On Tue, 26 Apr 2005 22:15:30 +0100, "Srinivas" <>
    wrote:

    >Hi,
    >
    >I am using ASP.NET SmtpMail to send email using the following code
    >
    >public void SendEmail(string From, string To, string Subject, StringBuilder
    >Message, string Attachment, string mailFormat)
    >{
    > MailMessage mailMessage = new MailMessage ();
    > mailMessage.From = From;
    > mailMessage.To = To;
    > mailMessage.Subject = Subject;
    > mailMessage.Body = Message.ToString ();
    >
    > if(mailFormat == "T")
    > {
    > mailMessage.BodyFormat = MailFormat.Text;
    > }
    > else if(mailFormat == "H")
    > {
    > mailMessage.BodyFormat = MailFormat.Html;
    > }
    >
    > SmtpMail.SmtpServer = "10.0.0.1";
    > SmtpMail.Send (mailMessage);
    >}
    >
    >This code executes fine without error. But the email goes and sits in the
    >"C:\Inetpub\mailroot\Queue" folder.
    >SMTP service is running and cdosys.dll and cdonts.dll are installed.
    >
    >My computer is connected to the internet through a Speedtouch 545 ADSL
    >router. I got the "10.0.0.1" by doing the ipconfig at command prompt.
    >
    >Can anyone please guide me in the right direction.
    >
    >Thanks,
    >
    >Srinivas
    >
    >
     
    Scott Allen, Apr 27, 2005
    #3
    1. Advertisements

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. Rupreet Singh

    Problems Sending Mail

    Rupreet Singh, Oct 14, 2003, in forum: Microsoft ASP .NET
    Replies:
    0
    Views:
    152
    Rupreet Singh
    Oct 14, 2003
  2. michi

    SMTP sending problems

    michi, Jan 23, 2004, in forum: Microsoft ASP .NET
    Replies:
    0
    Views:
    179
    michi
    Jan 23, 2004
  3. Srinivas

    Problems sending Email using ASP.NET

    Srinivas, Aug 15, 2005, in forum: Microsoft ASP .NET
    Replies:
    3
    Views:
    185
    Guest
    Aug 22, 2005
  4. Guest

    ASP.Net V 2.0 problems with sending email

    Guest, Jul 24, 2006, in forum: Microsoft ASP .NET
    Replies:
    8
    Views:
    203
    Mischa Kroon
    Jul 26, 2006
  5. rote
    Replies:
    8
    Views:
    196
Loading...

Share This Page