Code Monkey home page Code Monkey logo

Comments (11)

Synchro avatar Synchro commented on May 18, 2024

Can you provide some more info? De-personalised headers would be good.

from phpmailer.

valx76 avatar valx76 commented on May 18, 2024

What info do you need @Synchro ?

from phpmailer.

Synchro avatar Synchro commented on May 18, 2024

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.

valx76 avatar valx76 commented on May 18, 2024

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.

sabl0r avatar sabl0r commented on May 18, 2024

I think gmail doesn't let you set From to an address, which isn't confirmed in your gmail account.

from phpmailer.

Synchro avatar Synchro commented on May 18, 2024

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.

valx76 avatar valx76 commented on May 18, 2024

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.

Synchro avatar Synchro commented on May 18, 2024

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.

valx76 avatar valx76 commented on May 18, 2024

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.

Synchro avatar Synchro commented on May 18, 2024

Either subclass it or call GetSentMIMEMessage() instead.

from phpmailer.

valx76 avatar valx76 commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.