You mean sending the email or the receiving end?
Hello Lester,
if gmail.com is used for the SMTP service it won’t let you change the From address. Perhaps adding an option to use ReplyTo field could help as well.
Thanks,
Martin
Add this before Line 949 of https://github.com/lesterchan/wp-email/blob/master/wp-email.php#L949
$mail->AddReplyTo('replyto@email.com', 'Reply to name');
let me know if it works.
Hello Lester,
at this point we don’t have a place to test this, as we already asked our client to not use gmail.com for this kind of mailing. If you add the option to switch from “From” to “ReplyTo”, that would make your plugin more resilient.
Idealy you should always be using wp_mail to send the emails if there is no STMP configuration entered (I know that’s more and more testing). We use WP Mail SMTP plugin to configure SMTP on our websites and don’t see a point in entering it again in your plugin: http://wordpress.org/plugins/wp-mail-smtp/
Thanks,
Martin
Yeap. I agree with you. Ideally it should be using wp_mail. The code is old and it works so I will not touch it unless I have to.
Hello Lester,
I just sent an email to my gmail.com address and the SPF fails. Here’s an excerpt from headers:
Delivered-To: my-email@gmail.com
Received: by 10.221.72.205 with SMTP id yp13csp95494vcb;
Fri, 19 Sep 2014 00:45:23 -0700 (PDT)
X-Received: by 10.66.138.46 with SMTP id qn14mr12758081pab.77.1411112723502;
Fri, 19 Sep 2014 00:45:23 -0700 (PDT)
Return-Path: <my-email@foliovision.com>
Received: from p3plsmtpa08-06.prod.phx3.secureserver.net (p3plsmtpa08-06.prod.phx3.secureserver.net. [173.201.193.107])
by mx.google.com with ESMTP id m1si1545522pdr.159.2014.09.19.00.45.22
for <my-email@gmail.com>;
Fri, 19 Sep 2014 00:45:22 -0700 (PDT)
Received-SPF: fail (google.com: domain of my-email@foliovision.com does not designate 173.201.193.107 as permitted sender) client-ip=173.201.193.107;
Authentication-Results: mx.google.com;
spf=hardfail (google.com: domain of my-email@foliovision.com does not designate 173.201.193.107 as permitted sender) smtp.mail=my-email@foliovision.com
Received: from www.site.com ([162.242.234.125])
by p3plsmtpa08-06.prod.phx3.secureserver.net with
id svlM1o00K2j0KJy01vlMvK; Fri, 19 Sep 2014 00:45:22 -0700
X-Sender: the-actual-sender@site.com
Date: Fri, 19 Sep 2014 07:45:21 +0000
Return-Path: <my-email@foliovision.com>
To: my-email@gmail.com
From: Martin <my-email@foliovision.com>
So this is a problem – you should keep the Return-Path the real sender. Otherwise the SPF check fails. Notice that something adds the X-Sender field (probably the outgoing SMTP), but it appears this is not checked by SPF.
Thanks,
Martin