Email sending problem from asp.net application

Discussion in 'ASP .Net' started by Santosh, Mar 22, 2007.

  1. Santosh

    Santosh Guest

    Dear all, i am wrtiing following code for the sending email from the
    my asp application when i am working on the local machine i will work
    fine ans send email on the mentioned address. but when i deploy it on
    the server it doen not work. and also does not give any error.

    MailMessage newMessage = new MailMessage();
    newMessage.From =txtEmail.Text.Trim();
    newMessage.To="";
    newMessage.Subject="Comments-Suggestion";
    newMessage.Priority=System.Web.Mail.MailPriority.Normal;
    string msgBody = txtSuggestion.Text.Trim() ;
    SmtpMail.Send(newMessage);
    newMessage.Body = msgBody;


    please tell me what is the problem with in it.


    Regards,
    Santosh Shinde.
    Santosh, Mar 22, 2007
    #1
    1. Advertising

  2. Santosh

    Aidy Guest

    You need to specify how the mail is to be delivered. If you are using an
    external SMTP server you need to specify, or if you are using IIS' SMTP
    server you need to specify that too.

    Google these for more info;

    http://schemas.microsoft.com/cdo/configuration/sendusing

    http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory

    "Santosh" <> wrote in message
    news:...
    > Dear all, i am wrtiing following code for the sending email from the
    > my asp application when i am working on the local machine i will work
    > fine ans send email on the mentioned address. but when i deploy it on
    > the server it doen not work. and also does not give any error.
    >
    > MailMessage newMessage = new MailMessage();
    > newMessage.From =txtEmail.Text.Trim();
    > newMessage.To="";
    > newMessage.Subject="Comments-Suggestion";
    > newMessage.Priority=System.Web.Mail.MailPriority.Normal;
    > string msgBody = txtSuggestion.Text.Trim() ;
    > SmtpMail.Send(newMessage);
    > newMessage.Body = msgBody;
    >
    >
    > please tell me what is the problem with in it.
    >
    >
    > Regards,
    > Santosh Shinde.
    >
    Aidy, Mar 22, 2007
    #2
    1. Advertising

  3. Santosh

    Mark Rae Guest

    "Santosh" <> wrote in message
    news:...

    > Dear all, i am wrtiing following code for the sending email from the
    > my asp application when i am working on the local machine i will work
    > fine ans send email on the mentioned address. but when i deploy it on
    > the server it doen not work. and also does not give any error.
    >
    > MailMessage newMessage = new MailMessage();
    > newMessage.From =txtEmail.Text.Trim();
    > newMessage.To="";
    > newMessage.Subject="Comments-Suggestion";
    > newMessage.Priority=System.Web.Mail.MailPriority.Normal;
    > string msgBody = txtSuggestion.Text.Trim() ;
    > SmtpMail.Send(newMessage);
    > newMessage.Body = msgBody;
    >
    >
    > please tell me what is the problem with in it.


    How does it know where to find your SMTP queue...?
    http://www.systemnetmail.com/faq/3.1.1.aspx
    Mark Rae, Mar 22, 2007
    #3
  4. Santosh

    Santosh Guest

    On Mar 22, 3:51 pm, "Aidy" <> wrote:
    > You need to specify how the mail is to be delivered. If you are using an
    > external SMTP server you need to specify, or if you are using IIS' SMTP
    > server you need to specify that too.
    >
    > Google these for more info;
    >
    > http://schemas.microsoft.com/cdo/configuration/sendusing
    >
    > http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory
    >
    > "Santosh" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > Dear all, i am wrtiing following code for the sending email from the
    > > my asp application when i am working on the local machine i will work
    > > fine ans send email on the mentioned address. but when i deploy it on
    > > the server it doen not work. and also does not give any error.

    >
    > > MailMessage newMessage = new MailMessage();
    > > newMessage.From =txtEmail.Text.Trim();
    > > newMessage.To="";
    > > newMessage.Subject="Comments-Suggestion";
    > > newMessage.Priority=System.Web.Mail.MailPriority.Normal;
    > > string msgBody = txtSuggestion.Text.Trim() ;
    > > SmtpMail.Send(newMessage);
    > > newMessage.Body = msgBody;

    >
    > > please tell me what is the problem with in it.

    >
    > > Regards,
    > > Santosh Shinde.- Hide quoted text -

    >
    > - Show quoted text -


    i am trying following code

    MailMessage newMessage = new MailMessage();
    newMessage.From =txtEmail.Text.Trim();
    //newMessage.To ="";
    newMessage.To="";
    newMessage.Subject="Comments-Suggestion";
    newMessage.Priority=System.Web.Mail.MailPriority.Normal;
    string msgBody = txtSuggestion.Text.Trim() ;
    newMessage.Body = msgBody;
    SmtpMail.SmtpServer="gmail.com";
    //SmtpMail.SmtpServer="127.0.0.1";
    // Smtp configuration

    //SmtpMail.SmtpServer = "smtp.yahoo.com";
    // - smtp.gmail.com use smtp authentication
    newMessage .Fields.Add("http://schemas.microsoft.com/cdo/
    configuration/smtpauthenticate", "1");
    newMessage.Fields.Add("http://schemas.microsoft.com/cdo/
    configuration/sendusername", "");
    newMessage.Fields.Add("http://schemas.microsoft.com/cdo/
    configuration/sendpassword", "mypassword");
    // // - smtp.gmail.com use port 465 or 587
    newMessage.Fields.Add("http://schemas.microsoft.com/cdo/
    configuration/smtpserverport", "465");
    // // - smtp.gmail.com use STARTTLS (some call this SSL)
    newMessage.Fields.Add("http://schemas.microsoft.com/cdo/
    configuration/smtpusessl", "true");
    // try to send Mail
    //newMessage.Fields.Add("http://schemas.microsoft.com/cdo/
    configuration/smtpusessl", "true");
    SmtpMail.Send(newMessage);
    but it gives an error

    Please tell me what is the problem. can there is any other way
    Santosh, Mar 22, 2007
    #4
  5. Santosh

    Mark Rae Guest

    "Santosh" <> wrote in message
    news:...

    > but it gives an error


    I've never understood why people post on a technical newsgroup that they are
    getting an error, but then not actually say what the error is...!!!

    > Please tell me what is the problem. can there is any other way


    Please tell the newsgroup what the error is...
    Mark Rae, Mar 22, 2007
    #5
  6. Santosh

    Santosh Guest

    On Mar 22, 5:36 pm, "Mark Rae" <> wrote:
    > "Santosh" <> wrote in message
    >
    > news:...
    >
    > > but it gives an error

    >
    > I've never understood why people post on a technical newsgroup that they are
    > getting an error, but then not actually say what the error is...!!!
    >
    > > Please tell me what is the problem. can there is any other way

    >
    > Please tell the newsgroup what the error is...


    Sorry forget to mention the error the error is :

    The transport failed to connect to the server.
    Santosh, Mar 24, 2007
    #6
  7. Santosh

    Mark Rae Guest

    "Santosh" <> wrote in message
    news:...

    > On Mar 22, 5:36 pm, "Mark Rae" <> wrote:
    >> "Santosh" <> wrote in message
    >>
    >> news:...
    >>
    >> > but it gives an error

    >>
    >> I've never understood why people post on a technical newsgroup that they
    >> are
    >> getting an error, but then not actually say what the error is...!!!
    >>
    >> > Please tell me what is the problem. can there is any other way

    >>
    >> Please tell the newsgroup what the error is...

    >
    > Sorry forget to mention the error the error is :
    >
    > The transport failed to connect to the server.


    There you go!

    OK, so presumably you've done a normal Google search:
    http://www.google.co.uk/search?sour...he transport failed to connect to the server"

    and none of the suggested solutions has worked...?
    Mark Rae, Mar 24, 2007
    #7
  8. Santosh

    Santosh Guest

    On Mar 24, 7:11 pm, "Mark Rae" <> wrote:
    > "Santosh" <> wrote in message
    >
    > news:...
    >
    >
    >
    >
    >
    > > On Mar 22, 5:36 pm, "Mark Rae" <> wrote:
    > >> "Santosh" <> wrote in message

    >
    > >>news:...

    >
    > >> > but it gives an error

    >
    > >> I've never understood why people post on a technical newsgroup that they
    > >> are
    > >> getting an error, but then not actually say what the error is...!!!

    >
    > >> > Please tell me what is the problem. can there is any other way

    >
    > >> Please tell the newsgroup what the error is...

    >
    > > Sorry forget to mention the error the error is :

    >
    > > The transport failed to connect to the server.

    >
    > There you go!
    >
    > OK, so presumably you've done a normal Google search:http://www.google.co.uk/search?sourceid=navclient&ie=UTF-8&rls=GGLG,G...
    >
    > and none of the suggested solutions has worked...?- Hide quoted text -
    >
    > - Show quoted text -


    ya i am trying all the options but not any one work and lastely search
    on google.and getting help from google search.
    Santosh, Mar 26, 2007
    #8
    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. bivin
    Replies:
    1
    Views:
    714
    venkat
    Jun 27, 2003
  2. levon
    Replies:
    1
    Views:
    482
    Patrick Olurotimi Ige
    Jun 12, 2005
  3. Luke
    Replies:
    2
    Views:
    4,708
    Nigel Wade
    Mar 15, 2007
  4. gnewsgroup
    Replies:
    9
    Views:
    345
    gnewsgroup
    Apr 9, 2008
  5. rote
    Replies:
    8
    Views:
    767
Loading...

Share This Page