Mail not going to Inbox

Last post 04-20-2007 6:20 AM by digvijay.chauhan. 11 replies.

Sort Posts:

  • Mail not going to Inbox

    03-28-2007, 3:11 AM
    • Member
      point Member
    • pirus
    • Member since 03-28-2007, 7:07 AM
    • Nagpur, India
    • Posts 6
    Hi all,
    howz life there
    well  I have  developed a mail program ( ASP.NET / C# ) for my site which sends user passwords to their email
    addresses. However the problem is that my mails are not received in Inbox whereas they are
    diverted to the Spam folder. I am not able to resolve it niether I think there is any issue with code as its quite straight forward.
    Here is the code have a look if you could suggest any changes or hints that woul be quite helpful

    /************ The CODE ********************************/

    using dataclass;  // mydatabase class
    using System.Net.Mail;
    using System.SMTP;
    using System.Text;

    string to;
    string sub;
    string msg;
    Stringbuilder strbld=new Stringbuilder();

    to=sqlreader['email']; // email address is retrived from database
    sub="Your Login Information";
    strbld.Append("Hello" + sqlreader['username'] + "<br>");  // username from database
    strbld.Append("Your login name is :" + sqlreader['userlogin'] + "<br>");  // login id from database
    strbld.Append("Your login password is :" + sqlreader['userpassword'] + "<br>"); // password from database
    strbld.Append("Thank You <br>");
    strbld.Append("<br><br>");
    strbld.Append("Support Team <br>");
    strbld.Append("Mysite.com <br>");

    msg=strbld.ToString();

    MailMessage mlmsg = new MailMessage();
    mlmsg.body=msg;
    mlmsg.To.Add(new MailAddress(to));
    mlmsg.From=new MailAddress("support@mysite.com","Support Team");
    mlmsg.Subject=sub;
    mlmsg.IsBodyHtml=true;

    SmtpClient mailit = new SmtpClient("Myserver");
    mailit.Port=25;
    mailit.timeout=200;

    mailit.Send(mlmsg);



    /**************end of code **********************************/


    Thanks in advance.

    pIrus
    I4INDIAN
    Dreams in our eye, Goals are high
    Sky is not the limit, when we spread wings and fly

    www.Marketraise.com
    pIrus
    Dreams in our eyes, We are aiming high
    Sky is not the limit, When we spread wings and fly

    Marketraise.com
    Filed under: , , , ,
  • Re: Mail not going to Inbox

    03-28-2007, 3:25 AM
    • Star
      13,979 point Star
    • DMW
    • Member since 09-04-2002, 6:25 AM
    • Posts 2,006
    • Moderator

    Put the words SPAM-LOW on the front of the subject.

    In the page where the user clicks the button (or whatever) that asks for the password to be sent to them, add a highly visible note advising them to check their spam mail folder in case the mail is automatically routed there. 

    Regards

    Dave
  • Re: Mail not going to Inbox

    03-28-2007, 4:01 AM
    • Member
      point Member
    • pirus
    • Member since 03-28-2007, 7:07 AM
    • Nagpur, India
    • Posts 6

    Thanks Dave,

    for such a quick reply.

    I will just try it out.Smile 

     

    pIrus
    Dreams in our eyes, We are aiming high
    Sky is not the limit, When we spread wings and fly

    Marketraise.com
  • Re: Mail not going to Inbox

    03-28-2007, 8:26 AM
    • Member
      point Member
    • pirus
    • Member since 03-28-2007, 7:07 AM
    • Nagpur, India
    • Posts 6

    Hi Dave,

    I changed the subject text to "SPAM-LOW:Your Login Information" 

    however, still my email are not routed to Inbox, they are still diverted

    to Spam folder.

    Am i writing the subject text properly or it needs to be modified.

    Thanks

    pIrus

    I4INDIAN

    www.marketraise.com 

    pIrus
    Dreams in our eyes, We are aiming high
    Sky is not the limit, When we spread wings and fly

    Marketraise.com
  • Re: Mail not going to Inbox

    03-28-2007, 10:03 AM
    Answer
    • Star
      13,979 point Star
    • DMW
    • Member since 09-04-2002, 6:25 AM
    • Posts 2,006
    • Moderator

    Don't forget that the user has control over what they consider to be spam. If they've blocked you, then that's the end of the matter, and one of the reasons why you need to display a message on the page advising them to check for the message in their Junk E-mail folder.

    Sending an HTML-based email is also unnecessary and might spark an email filter to discard it, so you might want to consider sending it in plain text. 

    Regards

    Dave
  • Re: Mail not going to Inbox

    03-28-2007, 3:58 PM
    It is unfortunate that the new "Net.Mail" that .NET 2.0 uses just happens to conform to the pattern that most spam filters use to ID spam.  Working for a government agency we have spam filtering on out bound as well as inbound emails.  Using the new .Net "Net.Mail" class we get a message from our outbound filter that the HEADERS of the emails are causing our emails to be blocked as spam.  They don't even get past our own mail server!  The older "Web.Mail" never did this.  The fun part is that "Net.Mail" does not allow you to do anything to the headers, so you can't fix it.  I've posted on this issue before and never seen a solution beyond switching to a different software development package, so good luck getting this bit of stupidity fixed.  It is an inexcuseable piece of crappy coding by Microsoft when the exact same to, from, heading and body content sent via "Web.Mail" goes through but "Net.Mail" fails because the headers (that the code can't alter) look like spam. 
  • Re: Mail not going to Inbox

    03-28-2007, 3:59 PM
    It is unfortunate that the new "Net.Mail" that .NET 2.0 uses just happens to conform to the pattern that most spam filters use to ID spam.  Working for a government agency we have spam filtering on out bound as well as inbound emails.  Using the new .Net "Net.Mail" class we get a message from our outbound filter that the HEADERS of the emails are causing our emails to be blocked as spam.  They don't even get past our own mail server!  The older "Web.Mail" never did this.  The fun part is that "Net.Mail" does not allow you to do anything to the headers, so you can't fix it.  I've posted on this issue before and never seen a solution beyond switching to a different software development package, so good luck getting this bit of stupidity fixed.  It is an inexcuseable piece of crappy coding by Microsoft when the exact same to, from, subject and body content sent via "Web.Mail" goes through but "Net.Mail" fails because the headers (that the code can't alter) look like spam. 
  • Re: Mail not going to Inbox

    03-28-2007, 4:05 PM
    Sorry about the double post.  I'm used to being able to edit forum posts and spotted that I used the word 'heading' instead of 'subject'.  I thought I had hit the stop on the browser soon enough but I guess not. 
  • Re: Mail not going to Inbox

    03-28-2007, 4:35 PM
    Answer
    • Star
      9,642 point Star
    • uncleb
    • Member since 07-30-2002, 4:18 PM
    • Posts 1,863

    You probably can't do much - I get email from friends on comcast, and my email server marks them as SPAM.

    Have the user send you the email so you can see the exact error ( if it's even available)

    I would check the message source for any clues as to why it was marked as spam. (no subject, unlisted sending smtp,etc..)

    Are you sending directly through your own SMTP server, or are you using an ISP's SMTP server ?

    The reason I ask is that when I was using my own ( windows built-in) SMTP server, I would get bounces from some addresses because my server didn't have a reverseDNS lookup or PTR record. 

    Hope That Helps
    All that wander, are not lost...
    What were we talkin bout
  • Re: Mail not going to Inbox

    04-20-2007, 2:51 AM
    • Member
      point Member
    • pirus
    • Member since 03-28-2007, 7:07 AM
    • Nagpur, India
    • Posts 6

    Hi bucketofsqiud

    Thanks a lot for that pointer. I had stopped working more on mail sending

    as I could not figure out was wrong in it. And after DMW's reply that it might

    server issue or users choice, I never thought that something might be wrong

    in the code.

    Well, now I will try it again using Web.Mail class and hopefully

    this time will not land in SPAM folder Smile

    Thanks again 

    pIrus
    Dreams in our eyes, We are aiming high
    Sky is not the limit, When we spread wings and fly

    Marketraise.com
  • Re: Mail not going to Inbox

    04-20-2007, 3:03 AM
    • Member
      point Member
    • pirus
    • Member since 03-28-2007, 7:07 AM
    • Nagpur, India
    • Posts 6

    Thanks uncleb,

    I am using my own SMTP server.

    Although, I have checked for the headers but haven't found anything wrong.

    May be as you mentioned it might be DNS error. I will check on it also.

    Thanks 


     

    pIrus
    Dreams in our eyes, We are aiming high
    Sky is not the limit, When we spread wings and fly

    Marketraise.com
  • Re: Mail not going to Inbox

    04-20-2007, 6:20 AM
    • Participant
      1,577 point Participant
    • digvijay.chauhan
    • Member since 02-05-2007, 10:30 PM
    • Stockholm
    • Posts 370

    Yes, i had the same issue and its certainly the reverse dns lookup that fails.

    It will depend on the receivers email service provider but most providers will do a reverse dns lookup on the smtp server and will mark it as spam/suspecious.

    If you host it somewhere or use the System.NEt class's smtp correctly it shall work fine.

    Regards,

    Digvijay
    http://www.digvijay.eu
    http://blog.digvijay.eu

    --------
    Please remember to Mark As Answer if this post answered your question!
Page 1 of 1 (12 items)