I have the GoDaddy hosting and send mail using the following code:

 $to = "demomail@gmail.com";
 $subject = "Test mail";
 $message = "Hello! This is a simple email message.";
 $from = "info@brightmeup.com";
 $headers = "From:" . $from;
 echo "Mail Sent.";

When the mail arrives at its destination I see the following (in red outline)

enter image description here

I don't want to show the "via server" and for that there is an option to add a SPF record.

To do this I have followed the instructions in this page:

Managing DNS for Your Domain Names

but it's not working.

After that i have tried:

v=spf1 include:_spf.google.com ~all

as described in http://support.google.com/a/bin/answer.py?hl=en&answer=178723 but I still get the same result.

How can I solve this and prevent "via server" showing?


Your spf line is wrong, let's break it down:


Version 1 SPF, everything right there, let's see the next parameters:


Here you're specifying that your mail is valid if you're sending it from a Google Apps domain. Are you using Google Apps?, the next parameter:


Denies every other domain, so if you send from a non Google Apps domain, you'll be invalid in terms of SPF. You must change your include parameter to point to your sending server (probably something like include:spf.secureserver.net inferring from the image you posted).

Also, see ceejayoz response respecting DKIM. I forgot that for a non Google Apps Domain you have to include that.

| improve this answer | |
  • 1
    I believe for GoDaddy it's include:spf.secureserver.net. – ceejayoz Aug 29 '12 at 17:48
  • i ahve also tried the v=spf1 mx include:secureserver.net -all but still getting the same via ..... is there anything i can do to remove the via – Mayank swami Aug 29 '12 at 18:07
  • See that you must change it to include:spf.secureserver.net – Chiguireitor Aug 29 '12 at 19:35

SPF is only one of two parts of fixing this. The other is DKIM signing.


I'm a sender and I don't want my recipients to see the "via" link. What can I do?

Gmail checks whether emails are correctly authenticated. If your messages are sent by a bulk mailing vendor or by third-party affiliates, please publish an SPF record that includes the IPs of the vendor or affiliates which send your messages and sign your messages with a DKIM signature that is associated with your domain.

| improve this answer | |

I wouldn't use -all, unless you have everything else set up correctly, so stick with ~all.

The only time to use -all is if you have SRS - Sender Rewriting Scheme set up on your mail server. Anyone you send email to that has a forwarder set up, it will hard fail the SPF check on the message and not deliver it.

Here's an example of how this exact scenario plays out.

SRS Example

There's a lot to setting up and configuring emails, SPF, DKIM, DMARC, SRS, Etc. There's plenty of resources on the web on how to do it all, you just have to search for them.

The only way to know for sure if your email is properly authenticating, so that link doesn't show is to use one of the mail email authentication tools out there to verify your configuration. Here's a popular report a lot of people use to test their setup.

Email Authentication Report

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.