Solved

Emails from my VDS being sent to gmail's spam

Posted on 2010-08-22
7
371 Views
Last Modified: 2013-11-30
Hello Pros,

I have a Virtual dedicated server at myhosting.com . And recently the emails which are sent from domains which are on my VDS are being treated as spam on Gmail. I send them using System.Net.Mail as you can see in the code below. Is there anyway to make the mails so they wont go to spam at gmail? (Yahoo does not send them to span by the way)

Thanks in advance
public bool SendEmail(string strTo, string strFrom, string thebody, string theSubject)
    {
        MailAddress addrFrom = new MailAddress("cards@card-boutique.com", "card-boutique.com");
        MailAddress addrTo = new MailAddress(strTo);
        MailMessage objMM = new MailMessage(addrFrom, addrTo);

        string bodyToSend;

        bodyToSend = thebody;

        objMM.Subject = theSubject;
        objMM.Body = bodyToSend;
        objMM.IsBodyHtml = true;
        objMM.BodyEncoding = System.Text.Encoding.GetEncoding("UTF-8");

        SmtpClient smtp = new SmtpClient();
        smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;

        try
        {
            smtp.Send(objMM);
            return true;
        }
        catch (Exception ex)
        {
            return false;
        }
    }

Open in new window

0
Comment
Question by:sagir
  • 3
  • 2
7 Comments
 
LVL 37

Expert Comment

by:Neil Russell
ID: 33496314
You need to identify WHY gmail classifies them as spam first.  The code you have posted only sends the email, doesnt tell us anything at all.  
Look at the headers of an email that gmail has put in the spam folder and identify WHY it is spam.
Have you checked that your server is NOT on any blocklists anywhere?
0
 
LVL 3

Author Comment

by:sagir
ID: 33496349
Here is one of the headers of the mails that were sent to spam:

Delivered-To: kalika.anna@gmail.com
Received: by 10.231.16.203 with SMTP id p11cs34264iba;
        Sun, 22 Aug 2010 11:54:24 -0700 (PDT)
Received: by 10.231.156.65 with SMTP id v1mr5283998ibw.107.1282503264547;
        Sun, 22 Aug 2010 11:54:24 -0700 (PDT)
Return-Path: <cards@card-boutique.com>
Received: from xsmtp01.mail2web.com (xsmtp01.mail2web.com [168.144.250.211])
        by mx.google.com with ESMTP id x7si13266048ibd.70.2010.08.22.11.54.24;
        Sun, 22 Aug 2010 11:54:24 -0700 (PDT)
Received-SPF: neutral (google.com: 168.144.250.211 is neither permitted nor denied by best guess record for domain of cards@card-boutique.com) client-ip=168.144.250.211;
Authentication-Results: mx.google.com; spf=neutral (google.com: 168.144.250.211 is neither permitted nor denied by best guess record for domain of cards@card-boutique.com) smtp.mail=cards@card-boutique.com
Message-Id: <4c717260.8725e70a.302c.ffffdbc8SMTPIN_ADDED@mx.google.com>
Received: from [168.144.18.49] (helo=VPS-930)
      by xsmtp01.mail2web.com with esmtp (Exim 4.63)
      (envelope-from <cards@card-boutique.com>)
      id 1OnFgT-00063F-8x
      for kalika.anna@gmail.com; Sun, 22 Aug 2010 14:54:24 -0400
MIME-Version: 1.0
From: card-boutique.com <cards@card-boutique.com>
To: kalika.anna@gmail.com
Date: 22 Aug 2010 14:54:21 -0400
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: base64
Subject: =?utf-8?B?c2FnaXJvZGluQGdtYWlsLmNvbSDXqdeS15nXkCwg16nXnNeXINec15og15HXqNeb15Q=?=
0
 
LVL 16

Expert Comment

by:Kamal Khaleefa
ID: 33499715
you have to add SPF Record
ask the domin controller to add it for you

neutral (google.com: 168.144.250.211 is neither permitted nor denied by best guess record for domain of cards@card-boutique.com) client-ip=168.144.250.211;
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 3

Author Comment

by:sagir
ID: 33499884
king2002:
My domain is controlled in GoDaddy and I have an A-Record pointing to my VDS which is not on GoDaddy. How and where should I set the SPF record (And what should be it's value)?

Thanks
0
 
LVL 16

Accepted Solution

by:
Kamal Khaleefa earned 500 total points
ID: 33500012
A good tool for this would be http://www.kitterman.com/spf/validate.html

I would recommend that you use a SPF such as "v=spf1 -all" . Please take a look at http://www.openspf.org/ as this provides a wizard for creating SPF records. You should cross check any SFP you create with the above validation link.


for me i let my domain hosting (the planet)
add it for me
also you have to check for domain keys
0
 
LVL 3

Author Comment

by:sagir
ID: 33500264
king2002:

So on the above example as you can see on the email header, the server from which the email are being sent is 168.144.250.211 . So I should just add it in the ip4 section and that's it?
I get this record generated: v=spf1 ip4:168.144.250.211 a ~all

and the test result comes back:

Input accepted, querying now...
evaluating v=spf1 ip4:168.144.250.211 a ~all ...
SPF record passed validation test with pySPF (Python SPF library)!

is this it? just add it on my GoDaddy domain manager and I am done?

Thanks a lot.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Utilizing an array to gracefully append to a list of EmailAddresses
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video we show how to create an Accepted Domain in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Ac…
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question