Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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;
 mail($to,$subject,$message,$headers);
 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?

share|improve this question
add comment

migrated from stackoverflow.com Aug 30 '12 at 0:20

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 5 down vote accepted

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

v=spf1

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

include:_spf.google.com

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:

~all

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.

share|improve this answer
1  
I believe for GoDaddy it's include:spf.secureserver.net. –  ceejayoz Aug 29 '12 at 17:48
    
Exactly. Thanks for the correction. –  Chiguireitor Aug 29 '12 at 17:53
    
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
    
thankyou its works –  NullPoiиteя Sep 6 '12 at 16:30
add comment

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

http://support.google.com/mail/bin/answer.py?hl=en&answer=1311182

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.

share|improve this answer
    
would you mind tell me where can i get the dkim ? –  Mayank swami Aug 29 '12 at 18:10
    
DKIM isn't something you can just "go out and get". You'll need to implement some stuff. See en.wikipedia.org/wiki/DomainKeys_Identified_Mail and dkim.org. –  ceejayoz Aug 29 '12 at 19:17
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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