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. Problem to sending mail

Problem to sending mail

Scheduled Pinned Locked Moved ASP.NET
helpcomsysadminwindows-admindata-structures
3 Posts 3 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.
  • S Offline
    S Offline
    Shahdat Hosain
    wrote on last edited by
    #1

    I applied following code. Output show Msg sent successfully. Actually never it is sent to destination. Messages are only push to C:\inetpub\mailroot\queue; 1.I think IIS can not push the emails out on the internet.How can I look on SMTP response code. 2.I want to send emails from localhost. Now I confused how it possible sending a mail from anonymous mail address like "shahdat_mbstu@yahoo.com" through localhost, bcoz there no relation between my localhost and my mail address "shahdat_mbstu@yahoo.com". ; 3. Please help me!; public void CreateCopyMessage(string server) { MailAddress from = new MailAddress("shahdat_mbstu@yahoo.com", "Ben Miller"); MailAddress to = new MailAddress("shahdat45ict@yahoo.com", "Shahdat Kooras");//jane@contoso.com MailMessage message = new MailMessage(from, to); // message.Subject = "Using the SmtpClient class."; message.Subject = "Using the SmtpClient class."; message.Body = @"Using this feature, you can send an e-mail message from an application very easily."; // Add a carbon copy recipient. MailAddress copy = new MailAddress("Notification_List@contoso.com"); message.CC.Add(copy); SmtpClient client = new SmtpClient(server); // Include credentials if the server requires them. client.Credentials= client.Credentials = CredentialCache.DefaultNetworkCredentials; Console.WriteLine("Sending an e-mail message to {0} by using the SMTP host {1}.", to.Address, client.Host); try { client.Send(message); lblMessage.Text = "Message successfully sent"; } catch (Exception ex) { Console.WriteLine("Exception caught in CreateCopyMessage(): {0}", ex.ToString()); } }

    shahdat

    Y A 2 Replies Last reply
    0
    • S Shahdat Hosain

      I applied following code. Output show Msg sent successfully. Actually never it is sent to destination. Messages are only push to C:\inetpub\mailroot\queue; 1.I think IIS can not push the emails out on the internet.How can I look on SMTP response code. 2.I want to send emails from localhost. Now I confused how it possible sending a mail from anonymous mail address like "shahdat_mbstu@yahoo.com" through localhost, bcoz there no relation between my localhost and my mail address "shahdat_mbstu@yahoo.com". ; 3. Please help me!; public void CreateCopyMessage(string server) { MailAddress from = new MailAddress("shahdat_mbstu@yahoo.com", "Ben Miller"); MailAddress to = new MailAddress("shahdat45ict@yahoo.com", "Shahdat Kooras");//jane@contoso.com MailMessage message = new MailMessage(from, to); // message.Subject = "Using the SmtpClient class."; message.Subject = "Using the SmtpClient class."; message.Body = @"Using this feature, you can send an e-mail message from an application very easily."; // Add a carbon copy recipient. MailAddress copy = new MailAddress("Notification_List@contoso.com"); message.CC.Add(copy); SmtpClient client = new SmtpClient(server); // Include credentials if the server requires them. client.Credentials= client.Credentials = CredentialCache.DefaultNetworkCredentials; Console.WriteLine("Sending an e-mail message to {0} by using the SMTP host {1}.", to.Address, client.Host); try { client.Send(message); lblMessage.Text = "Message successfully sent"; } catch (Exception ex) { Console.WriteLine("Exception caught in CreateCopyMessage(): {0}", ex.ToString()); } }

      shahdat

      Y Offline
      Y Offline
      Yusuf
      wrote on last edited by
      #2

      check the event log for errors. That should give you a hint as to what is going on.

      Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]

      1 Reply Last reply
      0
      • S Shahdat Hosain

        I applied following code. Output show Msg sent successfully. Actually never it is sent to destination. Messages are only push to C:\inetpub\mailroot\queue; 1.I think IIS can not push the emails out on the internet.How can I look on SMTP response code. 2.I want to send emails from localhost. Now I confused how it possible sending a mail from anonymous mail address like "shahdat_mbstu@yahoo.com" through localhost, bcoz there no relation between my localhost and my mail address "shahdat_mbstu@yahoo.com". ; 3. Please help me!; public void CreateCopyMessage(string server) { MailAddress from = new MailAddress("shahdat_mbstu@yahoo.com", "Ben Miller"); MailAddress to = new MailAddress("shahdat45ict@yahoo.com", "Shahdat Kooras");//jane@contoso.com MailMessage message = new MailMessage(from, to); // message.Subject = "Using the SmtpClient class."; message.Subject = "Using the SmtpClient class."; message.Body = @"Using this feature, you can send an e-mail message from an application very easily."; // Add a carbon copy recipient. MailAddress copy = new MailAddress("Notification_List@contoso.com"); message.CC.Add(copy); SmtpClient client = new SmtpClient(server); // Include credentials if the server requires them. client.Credentials= client.Credentials = CredentialCache.DefaultNetworkCredentials; Console.WriteLine("Sending an e-mail message to {0} by using the SMTP host {1}.", to.Address, client.Host); try { client.Send(message); lblMessage.Text = "Message successfully sent"; } catch (Exception ex) { Console.WriteLine("Exception caught in CreateCopyMessage(): {0}", ex.ToString()); } }

        shahdat

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

        Please read this link, this will help you to resolve your issue. IIS Virtual SMTP server not sending. Mail stuck in mailroot\queue folder.

        cheers, Abhijit CodeProject MVP

        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