Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Sending Mail Problem

Sending Mail Problem

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netcomsysadminbeta-testing
9 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pampam110
    wrote on last edited by
    #1

    This is my code to send an email! but it didnt work

    private void SendMail(string from, string body)
    {

        string mailservername = "mail.myURL.com";
        string subject = "Contact Us FeedBack";
        MailMessage message = new MailMessage(from,"info@mowjelectric.com",subject,body);
        SmtpClient mailclient = new SmtpClient();
        mailclient.Host = mailservername;              
        mailclient.Send(message);   
        message.Dispose();      
    }
    

    and I manipulate ASP.NET Configuraton. and change SMTP Server name to : "mail.myURL.com" Any Idea? :)

    []D @ []v[] []D @ []v[]

    A M A 3 Replies Last reply
    0
    • P pampam110

      This is my code to send an email! but it didnt work

      private void SendMail(string from, string body)
      {

          string mailservername = "mail.myURL.com";
          string subject = "Contact Us FeedBack";
          MailMessage message = new MailMessage(from,"info@mowjelectric.com",subject,body);
          SmtpClient mailclient = new SmtpClient();
          mailclient.Host = mailservername;              
          mailclient.Send(message);   
          message.Dispose();      
      }
      

      and I manipulate ASP.NET Configuraton. and change SMTP Server name to : "mail.myURL.com" Any Idea? :)

      []D @ []v[] []D @ []v[]

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      pampam110 wrote:

      but it didnt work

      What do you mean by didn't work? Are you getting any error ? If yes, then what ?

      pampam110 wrote:

      string mailservername = "mail.myURL.com";

      pampam110 wrote:

      mailclient.Host = mailservername;

      Does you SMTP server configure properly ?

      Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you. View My Latest Article

      P 1 Reply Last reply
      0
      • A Abhijit Jana

        pampam110 wrote:

        but it didnt work

        What do you mean by didn't work? Are you getting any error ? If yes, then what ?

        pampam110 wrote:

        string mailservername = "mail.myURL.com";

        pampam110 wrote:

        mailclient.Host = mailservername;

        Does you SMTP server configure properly ?

        Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you. View My Latest Article

        P Offline
        P Offline
        pampam110
        wrote on last edited by
        #3

        Abhijit Jana wrote:

        What do you mean by didn't work? Are you getting any error ? If yes, then what ?

        No Error. I mean This Code didnt send any email :(

        Abhijit Jana wrote:

        Does you SMTP server configure properly ?

        How Can i Configure it? I talk to where i buy Host and Domain, But they didnt help me. :|

        []D @ []v[] []D @ []v[]

        A 1 Reply Last reply
        0
        • P pampam110

          Abhijit Jana wrote:

          What do you mean by didn't work? Are you getting any error ? If yes, then what ?

          No Error. I mean This Code didnt send any email :(

          Abhijit Jana wrote:

          Does you SMTP server configure properly ?

          How Can i Configure it? I talk to where i buy Host and Domain, But they didnt help me. :|

          []D @ []v[] []D @ []v[]

          A Offline
          A Offline
          Abhijit Jana
          wrote on last edited by
          #4

          If you are using SMTP Server of any web hosting site, I guess they can only help you to do it. Or Read some manual for that hosting site.

          pampam110 wrote:

          I talk to where i buy Host and Domain, But they didnt help me

          :doh:

          Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

          P 1 Reply Last reply
          0
          • A Abhijit Jana

            If you are using SMTP Server of any web hosting site, I guess they can only help you to do it. Or Read some manual for that hosting site.

            pampam110 wrote:

            I talk to where i buy Host and Domain, But they didnt help me

            :doh:

            Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

            P Offline
            P Offline
            pampam110
            wrote on last edited by
            #5

            Thanks for your help! I Check My Mail Box at http://mail.myURL.com/ "mail.myURL.com" is it my SMTP Server ? and another question is how can find my SMTP Server except Read Manual for this hosting site? :confused:

            []D @ []v[] []D @ []v[]

            P 1 Reply Last reply
            0
            • P pampam110

              Thanks for your help! I Check My Mail Box at http://mail.myURL.com/ "mail.myURL.com" is it my SMTP Server ? and another question is how can find my SMTP Server except Read Manual for this hosting site? :confused:

              []D @ []v[] []D @ []v[]

              P Offline
              P Offline
              Parwej Ahamad
              wrote on last edited by
              #6

              Try to find out with Provider if there mails are persisting in mail queue or not. OR is there any exception are raising in your application.

              Parwej Ahamad http://parwej.wordpress.com/

              1 Reply Last reply
              0
              • P pampam110

                This is my code to send an email! but it didnt work

                private void SendMail(string from, string body)
                {

                    string mailservername = "mail.myURL.com";
                    string subject = "Contact Us FeedBack";
                    MailMessage message = new MailMessage(from,"info@mowjelectric.com",subject,body);
                    SmtpClient mailclient = new SmtpClient();
                    mailclient.Host = mailservername;              
                    mailclient.Send(message);   
                    message.Dispose();      
                }
                

                and I manipulate ASP.NET Configuraton. and change SMTP Server name to : "mail.myURL.com" Any Idea? :)

                []D @ []v[] []D @ []v[]

                M Offline
                M Offline
                mrcooll
                wrote on last edited by
                #7

                you need to contact u r host and ask them about email settings. u can try to set SmtpServer property to '127.0.0.1'

                P 1 Reply Last reply
                0
                • M mrcooll

                  you need to contact u r host and ask them about email settings. u can try to set SmtpServer property to '127.0.0.1'

                  P Offline
                  P Offline
                  pampam110
                  wrote on last edited by
                  #8

                  my website is : www.mowjelectric.com and my smtp is : mail.mowjelectric.com!

                  private void SendMail(string from, string body)
                  {
                  string mailservername = "mail.mowjelectric.com";
                  string subject = "Contact Us FeedBack";
                  MailMessage message = new MailMessage(from,"info@mowjelectric.com",subject,body);
                  SmtpClient mailclient = new SmtpClient();
                  mailclient.Host = mailservername;
                  mailclient.Send(message);
                  message.Dispose();
                  }

                  Can u take a look in my code? Thanks!

                  []D @ []v[] []D @ []v[]

                  1 Reply Last reply
                  0
                  • P pampam110

                    This is my code to send an email! but it didnt work

                    private void SendMail(string from, string body)
                    {

                        string mailservername = "mail.myURL.com";
                        string subject = "Contact Us FeedBack";
                        MailMessage message = new MailMessage(from,"info@mowjelectric.com",subject,body);
                        SmtpClient mailclient = new SmtpClient();
                        mailclient.Host = mailservername;              
                        mailclient.Send(message);   
                        message.Dispose();      
                    }
                    

                    and I manipulate ASP.NET Configuraton. and change SMTP Server name to : "mail.myURL.com" Any Idea? :)

                    []D @ []v[] []D @ []v[]

                    A Offline
                    A Offline
                    Abhishek Sur
                    wrote on last edited by
                    #9

                    Does your mail server requires authentication .. . If so then login using authentication before sending mails.:rose:

                    Abhishek Sur


                    My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

                    **Don't forget to click "Good Answer" if you like to.

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups