Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Emails from my VDS being sent to gmail's spam

Posted on 2010-08-22
7
372 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Utilizing an array to gracefully append to a list of EmailAddresses
Pop culture is prime bait for hackers seeking to infect user’s computers and mobile devices with malicious malware. Hackers know exactly what the latest trends are online and know how to use them to their advantage.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…

840 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