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. E-Mailing in ASP .NET

E-Mailing in ASP .NET

Scheduled Pinned Locked Moved ASP.NET
csharphtmlsysadminhelp
4 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.
  • K Offline
    K Offline
    kvsreedhar
    wrote on last edited by
    #1

    any one please help me I have the following code for Emailing . My doubt is I am able to send mail only to gmail(as a spam) but not to other mail like yahoo(not even as a spam) etc. What could be the reason .I have even configured web.config file and ....Relay->127.0.0.1 kindly help me :rose:Thanks in advance:rose: ----------> //create the mail message MailMessage mail = new MailMessage(); //set the addresses mail.From = new MailAddress(txtFrom .Text.Trim ()); mail.To.Add(txtTo.Text.Trim ()); //set the content mail.Subject = txtSubject .Text ; //first we create the Plain Text part AlternateView plainView = AlternateView.CreateAlternateViewFromString("Some Plain Text" , null, "text/plain"); //then we create the Html part AlternateView htmlView = AlternateView.CreateAlternateViewFromString("<b>"+txtBody .Text.Trim ()+"</b>", null, "text/html"); mail.AlternateViews.Add(plainView); mail.AlternateViews.Add(htmlView); //send the message SmtpClient smtp = new SmtpClient("127.0.0.1"); //specify the mail server address try { smtp.Send(mail); Response.Write("Mail Sent..."); txtBody.Text = ""; txtFrom.Text = ""; txtSubject.Text = ""; txtTo.Text = ""; } catch (Exception ex) { Response.Write (ex.ToString ()); } <---------->

    Kovuru Sreedhar

    E 1 Reply Last reply
    0
    • K kvsreedhar

      any one please help me I have the following code for Emailing . My doubt is I am able to send mail only to gmail(as a spam) but not to other mail like yahoo(not even as a spam) etc. What could be the reason .I have even configured web.config file and ....Relay->127.0.0.1 kindly help me :rose:Thanks in advance:rose: ----------> //create the mail message MailMessage mail = new MailMessage(); //set the addresses mail.From = new MailAddress(txtFrom .Text.Trim ()); mail.To.Add(txtTo.Text.Trim ()); //set the content mail.Subject = txtSubject .Text ; //first we create the Plain Text part AlternateView plainView = AlternateView.CreateAlternateViewFromString("Some Plain Text" , null, "text/plain"); //then we create the Html part AlternateView htmlView = AlternateView.CreateAlternateViewFromString("<b>"+txtBody .Text.Trim ()+"</b>", null, "text/html"); mail.AlternateViews.Add(plainView); mail.AlternateViews.Add(htmlView); //send the message SmtpClient smtp = new SmtpClient("127.0.0.1"); //specify the mail server address try { smtp.Send(mail); Response.Write("Mail Sent..."); txtBody.Text = ""; txtFrom.Text = ""; txtSubject.Text = ""; txtTo.Text = ""; } catch (Exception ex) { Response.Write (ex.ToString ()); } <---------->

      Kovuru Sreedhar

      E Offline
      E Offline
      Expert Coming
      wrote on last edited by
      #2

      Check to see if your IP Address(external) is blocked, or on a spam list. Also make sure you aren't sending messages with keywords that might tag it as spam.

      The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

      K 1 Reply Last reply
      0
      • E Expert Coming

        Check to see if your IP Address(external) is blocked, or on a spam list. Also make sure you aren't sending messages with keywords that might tag it as spam.

        The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo

        K Offline
        K Offline
        kvsreedhar
        wrote on last edited by
        #3

        what are the possible keywords for spam mail?

        Kovuru Sreedhar

        S 1 Reply Last reply
        0
        • K kvsreedhar

          what are the possible keywords for spam mail?

          Kovuru Sreedhar

          S Offline
          S Offline
          Sathesh Sakthivel
          wrote on last edited by
          #4

          it amy be any exe

          SSK. Anyone who says sunshine brings happiness has never danced in the rain.

          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