Phpmailer: Red question mark appearing beside the domain's email

Created on 30 Nov 2016  路  21Comments  路  Source: PHPMailer/PHPMailer

Hello! I am using my domain's email account to send emails to users, the problem is, upon receiving, a red question mark appearing beside the domain's email. Here is the sample code:

` require 'PHPMailer-master/PHPMailerAutoload.php';

$mail = new PHPMailer;

$mail->isSMTP();
$mail->SMTPDebug = 0;
$mail->Debugoutput = 'html';
$mail->Host = "mail.mydomain.com";
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
$mail->SMTPAuth = true;
$mail->Username = "[email protected]";
$mail->Password = "emailpassword";
$mail->setFrom('[email protected]', 'Domain Name');
$mail->addAddress('[email protected]', 'User Name');

$mail->Subject = "This is the subject.";
$mail->Body = "This is a Message.";

if (!$mail->send()) {
echo "Error sending message";
} else {
echo "Message sent!";
}
?>`

What do I need to do to make the red question mark disappears?

As of now I am just only testing PHPMailer out, and hopefully, if I resolved this, will implement it on the website.

Most helpful comment

If you鈥檙e not going to read what I said there鈥檚 no point in me saying anything else. This is not a PHPMailer issue.

All 21 comments

What do you mean by "red question mark". Are you talking about when they receive the email in something such as gmail, and they are getting the message flagged with a question mark in their webmail client?

The red question mark appears instead of the profile photo, and when you hover it, it says that gmail.com can't verify that domain.com actually send this email.

Assuming you have your domain set up properly to send email (reverse dns, etc), try using DKIM with phpmailer. I had issues with gmail saying emails weren't legitimate before I enabled DKIM.

How? I asked my hosting provider and it says that DKIM and SPF is already enabled to my account, I am using a shared hosting service.

It might help if you posted a screen shot. It's really unclear where this problem is.

gmail

That is only my problem, when sending an email using my domain's email + phpmailer I get that. (I even tried domain's email + gmail and domain's email + mail() and still get that.)

Can you view source on the message and post the headers here; they will usually say what the problem is.

orig msg

No, do what I said - view source of the message and post the headers, as text.

Delivered-To: [email protected]
Received: by 10.237.36.7 with SMTP id r7csp126644qtc;
        Tue, 29 Nov 2016 22:02:10 -0800 (PST)
X-Received: by 10.99.97.15 with SMTP id v15mr57306605pgb.10.1480485730049;
        Tue, 29 Nov 2016 22:02:10 -0800 (PST)
Return-Path: <[email protected]>
Received: from caracal.maple.relay.mailchannels.net (caracal.maple.relay.mailchannels.net. [23.83.214.30])
        by mx.google.com with ESMTPS id n23si62876213pfj.268.2016.11.29.22.02.09
        for <[email protected]>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Tue, 29 Nov 2016 22:02:09 -0800 (PST)
Received-SPF: softfail (google.com: domain of transitioning [email protected] does not designate 23.83.214.30 as permitted sender) client-ip=23.83.214.30;
Authentication-Results: mx.google.com;
       spf=softfail (google.com: domain of transitioning [email protected] does not designate 23.83.214.30 as permitted sender) [email protected]
X-Sender-Id: iconceptglobal|x-authuser|[email protected]
Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id B64ACA1BCB for <[email protected]>; Wed, 30 Nov 2016 06:02:08 +0000 (UTC)
Received: from virgo.zoom.ph (ip-10-220-3-24.us-west-2.compute.internal [10.220.3.24]) by relay.mailchannels.net (Postfix) with ESMTPA id E1923A1B5A for <[email protected]>; Wed, 30 Nov 2016 06:02:07 +0000 (UTC)
X-Sender-Id: iconceptglobal|x-authuser|[email protected]
Received: from virgo.zoom.ph (virgo.zoom.ph [10.135.9.54]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.7.8); Wed, 30 Nov 2016 06:02:08 +0000
X-MC-Relay: Neutral
X-MailChannels-SenderId: iconceptglobal|x-authuser|[email protected]
X-MailChannels-Auth-Id: iconceptglobal
X-MC-Loop-Signature: 1480485728226:2615264436
X-MC-Ingress-Time: 1480485728225
Received: from mail-qk0-f182.google.com ([209.85.220.182]:36094) by virgo.zoom.ph with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87) (envelope-from <[email protected]>) id 1cBxy1-0039B0-B0 for [email protected]; Wed, 30 Nov 2016 14:02:05 +0800
Received: by mail-qk0-f182.google.com with SMTP id n21so199451019qka.3
        for <[email protected]>; Tue, 29 Nov 2016 22:02:05 -0800 (PST)
X-Gm-Message-State: AKaTC006YjUcZeXcUWOAt54A5wUa8rCXBzJ8gUk0m+pMQGDZfts+vWKgpBxUOFo/doXcTJ4bJSm1Bx1fAhtHkA==
X-Received: by 10.55.190.1 with SMTP id o1mr26726008qkf.305.1480485724145; Tue, 29 Nov 2016 22:02:04 -0800 (PST)
MIME-Version: 1.0
Received: by 10.12.166.154 with HTTP; Tue, 29 Nov 2016 22:02:03 -0800 (PST)
From: Domain - Information <[email protected]>
Date: Wed, 30 Nov 2016 14:02:03 +0800
X-Gmail-Original-Message-ID: <CADgT1k-wWwduro7GgqsmpqnFG8TT21dO88kc9YkeXYHSqGzFuw@mail.gmail.com>
Message-ID: <CADgT1k-wWwduro7GgqsmpqnFG8TT21dO88kc9YkeXYHSqGzFuw@mail.gmail.com>
Subject: asdasd
To: [email protected]
Content-Type: multipart/alternative; boundary=94eb2c0438a4aed2e205427e7198
X-AuthUser: [email protected]

--94eb2c0438a4aed2e205427e7198
Content-Type: text/plain; charset=UTF-8

asdasd

--94eb2c0438a4aed2e205427e7198
Content-Type: text/html; charset=UTF-8

<div dir="ltr">asdasd<br></div>

--94eb2c0438a4aed2e205427e7198--

The critical part is this:

Received-SPF: softfail (google.com: domain of transitioning [email protected] does not designate 23.83.214.30 as permitted sender) client-ip=23.83.214.30;
Authentication-Results: mx.google.com;
spf=softfail (google.com: domain of transitioning [email protected] does not designate 23.83.214.30 as permitted sender) [email protected]

You need to add your source address to your SPF record; there's nothing wrong with your code or the message.

Do you mean by source address is this 23.83.214.30 ?

Yes. You would add that to your SPF using a clause like ip4:23.83.214.30, or an appropriate include. It will let you get an SPF 'pass' result.

please tell me also

Delivered-To: [email protected]
Received: by 2002:a9d:be9:0:0:0:0:0 with SMTP id 96-v6csp2163081oth;
        Sat, 21 Apr 2018 18:16:54 -0700 (PDT)
X-Google-Smtp-Source: AIpwx49gmxe0W8xiDoih51pCloV/Rx4+aNHemHiEUPEPVR3VHaNfTJYxEj8Up16vViM1mrK3gBs7
X-Received: by 2002:a9d:19a6:: with SMTP id k35-v6mr10789474otk.328.1524359814678;
        Sat, 21 Apr 2018 18:16:54 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1524359814; cv=none;
        d=google.com; s=arc-20160816;
        b=WK9EAjl5x+HOCfZWQm2MaYLGln/AQzbWcBEhk2xjMFlT7iUBtJooUEbHRb4IWIChyM
         TS25Vd1Q6EbacPSRMviEkd3qA3tqp6i8XHsFHPPbzm39+W1aZXwe/JIWHlmnHBRwjQbx
         Pxwd+i8wdNXG/fRil7RUP2mqW09tTbpBoKrG0QQYxda5HM6TqeiS+tjALou1+1DmJ1Zj
         x/SQXxaGjl1Ebp9NSOWDUlvcEsYHL9hKfhW87tBBP3mk+78S14QDrg6DBApW4MPYzrpu
         zkgkGi1bSUytYrL0BIj/1WtLQmWGv4LNtdG5UDEuoETGa+x9AFR2CjTACbMp634J0ggz
         RNJw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=user-agent:message-id:organization:subject:to:from:date
         :content-transfer-encoding:mime-version:dkim-signature
         :arc-authentication-results;
        bh=7k8kELJAjYt2Un0Fk2wa4d3uziMokmA+Y2ZnI6jXJH0=;
        b=fs30KIJ5Q2Ukx2Pjo0z3uoEM8O6GRosrQtSmIZzibRlsn4I/9UtiGy/ZTcX0svhpjy
         vfSUm6i8plmQ8ho/IEmxOiU1+zlGW6bx0LAwGf2UY2WW7CR3rEuW9Yzjw+mTGabsEAVX
         twTyj/1HV+V/pBrkw6OAhKku3uMJTRBylyzFBKVfgyAlNC53g5ffSmWkXJtYc334AGpq
         Qpm3YLiIPaI5/pYW++4nvK4a644cBEXUI1xN/TCd1lw4uZCTUbafEY76WlVlmUutAhog
         xIBcZXORQatFDLNu7CvnPIE/4kcqkUHHeFyhWHHxYtuY3bHJMf2Xxcn03DypD9PRUOiz
         2tyw==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=fail [email protected] header.s=default header.b=Azn+Rc9z;
       spf=softfail (google.com: domain of transitioning [email protected] does not designate 192.185.59.4 as permitted sender) [email protected];
       dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=tanaksh.com
Return-Path: <[email protected]>
Received: from gateway20.websitewelcome.com (gateway20.websitewelcome.com. [192.185.59.4])
        by mx.google.com with ESMTPS id j7-v6si3450692otd.398.2018.04.21.18.16.54
        for <[email protected]>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sat, 21 Apr 2018 18:16:54 -0700 (PDT)
Received-SPF: softfail (google.com: domain of transitioning [email protected] does not designate 192.185.59.4 as permitted sender) client-ip=192.185.59.4;
Authentication-Results: mx.google.com;
       dkim=fail [email protected] header.s=default header.b=Azn+Rc9z;
       spf=softfail (google.com: domain of transitioning [email protected] does not designate 192.185.59.4 as permitted sender) [email protected];
       dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=tanaksh.com
Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 7646D400D622F for <[email protected]>; Sat, 21 Apr 2018 20:16:54 -0500 (CDT)
Received: from cloud266.hostgator.com ([50.116.95.63]) by cmsmtp with SMTP id A3ccfsCcC6il3A3ccftBDp; Sat, 21 Apr 2018 20:16:54 -0500
X-Authority-Reason: ss=1
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tanaksh.com ; s=default; h=Message-ID:Subject:To:From:Date:Content-Transfer-Encoding: Content-Type:MIME-Version:Sender:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=7k8kELJAjYt2Un0Fk2wa4d3uziMokmA+Y2ZnI6jXJH0=; b=Azn+Rc9z9OutzjlWTrotCp8r3J VNNkqkv9m52Bwsxw3SC6reDMISyF+NsBMPBDuKlw5n3Y+FLOrVNmM8OYWu2u460q8aEzIa/h9rzFA tnKmNNfAqWiJdax2vQkVaqDKbzFgjk/Hbam61VMosz2/0x9yJeigB4dqy/5UY8AvHBxqN+QdaY1X/ MzMr7+K65Tg0lHX094kylQLEc7b9R4NgfvxxumvEQ77vudq7vdPY0Z0fu/cPfulPJyWPX49mOniaM yjyDjIDC0X/PRMtRtfFTVLKZHVXH9wzNAtlXONPaRXoYU9S+Ui5ggT5HC9UhmDqmkR8FJgBCd5N9i OfJZljyw==;
Received: from [127.0.0.1] (port=27809 helo=cloud266.hostgator.com) by cloud266.hostgator.com with esmtpa (Exim 4.89_1) (envelope-from <[email protected]>) id 1fA3cc-0029cw-9t for [email protected]; Sat, 21 Apr 2018 20:16:54 -0500
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII; format=flowed
Content-Transfer-Encoding: 7bit
Date: Sat, 21 Apr 2018 19:16:54 -0600
From: Tanaksh <[email protected]>
To: [email protected]
Subject: sdasdasd
Organization: Tanaksh
Message-ID: <[email protected]>
X-Sender: [email protected]
User-Agent: Roundcube Webmail/1.2.7
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - cloud266.hostgator.com
X-AntiAbuse: Original Domain - gmail.com
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - tanaksh.com
X-BWhitelist: no
X-Source-IP: 127.0.0.1
X-Source-L: Yes
X-Exim-ID: 1fA3cc-0029cw-9t
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-Source-Sender: (cloud266.hostgator.com) [127.0.0.1]:27809
X-Source-Auth: [email protected]
X-Email-Count: 3
X-Source-Cap: b3VyMHlodXA7b3VyMHlodXA7Y2xvdWQyNjYuaG9zdGdhdG9yLmNvbQ==
X-Local-Domain: yes

Test

That message was not sent with PHPMailer. It has SPF, DKIM and DMARC failures, so I鈥檓 not surprised you鈥檙e having trouble.

But mails are show red question mark in gmail so what can i do please help me i searched lot of on google but no answer found hostgator will not help me please do anything synchro

If you鈥檙e not going to read what I said there鈥檚 no point in me saying anything else. This is not a PHPMailer issue.

So no solution forme?

Maybe learn to read?

@prabhmeet133 ... Its been said that the issue you are referring to is a DNS/Domain Config problem.
Authentication-Results: mx.google.com;
dkim=fail
spf=softfail
dmarc=fail

So you need to address the problem ... outside phpmailer

Was this page helpful?
0 / 5 - 0 ratings