?
Solved

Emails from my VDS being sent to gmail's spam

Posted on 2010-08-22
7
Medium Priority
?
380 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
[X]
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
  • 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
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 2000 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

When you’re making plans to join the modern business race, you should analyze various details that may affect your results. Nowadays, millions of businesses are trying to grow into established and appreciated professional enterprises.
We aren’t perfect, just like everyone else.  Check out the email errors our community caught and learn the top errors every email marketer should avoid.
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
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…
Suggested Courses
Course of the Month11 days, 3 hours left to enroll

770 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