Comments (11)
Can you provide some more info? De-personalised headers would be good.
from phpmailer.
What info do you need @Synchro ?
from phpmailer.
Like I said - the received headers you're seeing, the values you're putting into your config. I don't know what you mean by 'SMTP address'.
from phpmailer.
Oh right. By SMTP adress, I mean SMTP host (GMail here).
Code - SMTP config :
$phpmailer->IsSMTP();
$phpmailer->Host = 'smtp.gmail.com';
$phpmailer->SMTPAuth = true;
$phpmailer->Username = '[email protected]';
$phpmailer->Password = '__';
$phpmailer->SMTPSecure = 'ssl';
$phpmailer->Port = 465;
In the header, I have : "From: Val [email protected]".
"Val" is the name I pass to the "FromName" property so it works.
But as you can see, the "From" property is not applied, the adress is one use for SMTP authentication..
from phpmailer.
I think gmail doesn't let you set From to an address, which isn't confirmed in your gmail account.
from phpmailer.
Can you view source on the message and paste the exact headers? What would be useful is to get the headers generated before sending (look at $phpmailer->PreSend())
too so we can see if gmail is altering them.
What @sabl0r is probably true too.
Incidentally you're using obsolete settings for gmail - you should be using:
$phpmailer->SMTPSecure = 'tls';
$phpmailer->Port = 587;
from phpmailer.
I modified the SMTP for GMail, thanks for that !
The $phpmailer->PreSend()
function just returns me true
..
And finally, here is the headers :
Delivered-To: [email protected]
Received: by 10.204.228.197 with SMTP id jf5csp21717bkb;
Wed, 1 May 2013 10:34:56 -0700 (PDT)
X-Received: by 10.180.182.110 with SMTP id ed14mr30792578wic.6.1367429696334;
Wed, 01 May 2013 10:34:56 -0700 (PDT)
Return-Path: <[email protected]>
Received: from mail-wi0-x242.google.com (mail-wi0-x242.google.com [2a00:1450:400c:c05::242])
by mx.google.com with ESMTPS id mb1si172485wic.91.2013.05.01.10.34.56
for <[email protected]>
(version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
Wed, 01 May 2013 10:34:56 -0700 (PDT)
Received-SPF: pass (google.com: domain of [email protected] designates 2a00:1450:400c:c05::242 as permitted sender) client-ip=2a00:1450:400c:c05::242;
Authentication-Results: mx.google.com;
spf=pass (google.com: domain of [email protected] designates 2a00:1450:400c:c05::242 as permitted sender) [email protected];
dkim=pass [email protected]
Received: by mail-wi0-x242.google.com with SMTP id hi8so769860wib.9
for <[email protected]>; Wed, 01 May 2013 10:34:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=x-received:date:to:from:subject:message-id:x-priority:x-mailer
:mime-version:content-transfer-encoding:content-type;
bh=sRlGTsD70quVJL3NKaMh1HXmdtMDcDlI5yPTBH/emo8=;
b=dqOTTcxL1aC51lsJEb8NDVrf3JXnaWdUL2OpXbCM2hsK/Vz3Wiw/zpEaa6ukIbrWF8
FtYSC37vl/vvOWR3f28Kq791u49uGfb0+l2VZfQIfpTX/W3knNEvyVgRq5N9ZWWAtFz0
LVX1Dg1IZ0eBP4Cs8hfxX0yXjdBsWrPSUaddTrGkpsZACG4x7Ffy2HLGTPEoZ1VorDjB
3ZyQHBw1S4Z+09/WzeHZDuVDxsbPtKdUA+HmvoJ9Y3iEwLThBY+pCzxlU//5ErVPzJW4
w8iKuTAsVtbxAFtY8PV381lRE3cUGb7Ryt3fiIKZ1VE1mRBvp125vuh4Gm2qNc+3Z+Vj
oYQw==
X-Received: by 10.180.105.231 with SMTP id gp7mr3461230wib.23.1367429696247;
Wed, 01 May 2013 10:34:56 -0700 (PDT)
Return-Path: <[email protected]>
Received: from 127.0.0.1 [[JUST REMOVED MY IP HERE]]
by mx.google.com with ESMTPSA id x13sm5338346wib.3.2013.05.01.10.34.53
for <[email protected]>
(version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
Wed, 01 May 2013 10:34:55 -0700 (PDT)
Date: Wed, 1 May 2013 17:34:51 +0000
Return-Path: <[email protected]>
To: [email protected]
From: Wordpress testing <[email protected]>
Subject: Newsletter to contributors
Message-ID: <[email protected]>
X-Priority: 3
X-Mailer: PHPMailer 5.2.6 (https://github.com/PHPMailer/PHPMailer/)
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/html; charset=iso-8859-1
from phpmailer.
That's good - we can see that the 'From' header is missing an address. Now for checking what was sent:
$phpmailer->PreSend();
echo $phpmailer->MIMEHeader;
and compare the two (ignoring 'received' headers). If the From header was set correctly before sending, it does indeed look like gmail is stripping it.
from phpmailer.
I tried to put your code before the email sending but it gives me an error :
Fatal error: Cannot access protected property PHPMailer::$MIMEHeader
from phpmailer.
Either subclass it or call GetSentMIMEMessage() instead.
from phpmailer.
What I have with GetSentMIMEMessage()
is :
Date: Thu, 2 May 2013 17:55:44 +0000 Return-Path: To: [email protected] From: Wordpress testing Subject: Newsletter to contributors Message-ID: <[email protected]> X-Priority: 3 X-Mailer: PHPMailer 5.2.6 (https://github.com/PHPMailer/PHPMailer/) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="b1_1714bd4c92518b8e7644c30334bfbae2"
So, Gmail seems to break the From
(email) attribute.
Thanks for the help, I'm closing the issue !
from phpmailer.
Related Issues (20)
- PHP Parse error: syntax error, unexpected token "use" HOT 15
- Setting Up PHPMailer with Microsoft Azure - Encountering Errors HOT 3
- addBCC doesn't work without AddAddress HOT 10
- SMTP Error: Could not connect to SMTP host. STARTTLS command failed Unrecognized command 'STARTTLS' HOT 9
- "Invalid address: (cc): " HOT 2
- Gmail
- hi i have problem- -function open ssl_pkey_free is depraced since php 8.0 HOT 2
- send differents body for mulitple bcc addresses in one send command HOT 4
- T
- Add the possibility of changing @phpmailer.0 string in asHtml method when composing image cid. HOT 2
- Missing header termination in multipart/mixed container HOT 2
- Issues with sending emails HOT 13
- 405 Not Allowed HOT 4
- SMTP Authentication not working with special characters like "ยง" HOT 1
- Withdraw/recall HOT 2
- edebug() should probably also get ride of "\r\n" when using LoggerInterface HOT 1
- postfix installation problem in PHP 5.5 test suite
- Not sending email when subject has first and last name in it HOT 7
- How do I only get the SMTP ERROR from debugging? HOT 1
- Can you add possibility to customized dsn by recipient ? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpmailer.