Solved

Emails from my VDS being sent to gmail's spam

Posted on 2010-08-22
7
368 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Do email signature updates give you a headache?

Do you feel like you are constantly making changes to email signatures? Are the images not formatting how you want them to? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today.

 
LVL 3

Author Comment

by:sagir
Comment Utility
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
Comment Utility
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
Comment Utility
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Suggested Solutions

MS outlook is a premier email client that enable you to send and receive the e-mails with various file formats of attachments such as document files, media file, and many others formats. There is some scenario occurs when a receiver of an e-mail mes…
Email signatures have numerous marketing benefits. Here are 8 top reasons to turn your email signature into a marketing channel.
In this video we show how to create an Address List 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 Organization >> Ad…
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now