Email should come under same convestaion - php

I am sending email using php mailer and email is going fine to the inbox
but next time when i reply back instead of email coming to under same conversation it create a new email even it should show all the email subject
any one has an idea ?

The email you send via php must have a header
Reply-To: <from-email-address>
From: <from-email-address>
as well as a
To: <destination-email-address>
header line for it to appear as a conversation thread.
Also the subject line should be the same or be the same with a prepended 'Re: '

Related

How to use emoji in email subject line, send via PHPMailerClass

We are trying to send email with Emoji in subject line using our Email Api which is using PHPmailer class and powerMTA port25 for relay.
surprisingly when Email sent from our Email Api reachs yahoo and when we look into "view raw message" our subject looks like:
=?utf-8?Q?=F0=9F=91=89_Overtake_The_Year_End_Price_Drop.?=
what we sent was:
👉 Overtake The Year End Price Drop
On the other hand when look into email sent from some random ESP it's "view raw message" appears as what they had sent:
Subject: 👉Updates on Your Pre-Approved Loan offer
Please help to understand where things are getting wrong.
Set PHPMailer to use UTF-8, then go ahead and use it:
$mail->CharSet = 'utf-8';
$mail->Subject = '👉 Overtake…';

Gmail telling what I am using to send email

When I send an email using phpmailer to gmail, and I look the email source, I see the following next to the "from" field:
"Using PHPMailer 6.1.7 (https://github.com/PHPMailer/PHPMailer)"
For security reasons I'd prefer to remove that if it's possible, but I don't know if this is Gmail being smart or phpmailer appending it to every email message I send.
How can I remove it?
Thanks
This appears in the X-Mailer header. As per the docs, you can remove this header altogether by setting it to a space, like this:
$mail->XMailer = ' ';
If it's appearing somewhere else, I'll need to see the rest of your code and the headers of a message you've received in gmail.

Get Email To Receiver When Submitted And Also Sender Get Submission Copy using PHPMailer

I am newbie with PHPMailer library , I want to get emails from my contact form But on submission of form I want sender also get a copy of mail With additional message as " thanks for registering with us." As I gone through PHP mailer examples We can use addCC();. But how to embed additional msg.
Could you please help me with this ?
Using CC or BCC will always result in identical message being sent to all; If you want the messages to be different for different recipients, you must send separate messages with different bodies. With PHPMailer:
$mail->addAddress('recipient1#example.com');
$mail->Body = "hello abc";
$mail->send();
$mail->clearAddresses();
$mail->addAddress('recipient2#example.com');
$mail->Body = "hello xyz";
$mail->send();
It's important to call clearAddresses as otherwise the second message will be sent to both recpients.

Does Gmail not allow sender to set a return path value to receive bounce messages?

I am using Swift Mailer to check for bounced messages. I have created one separate account for bounce messages, however when I set the return path, it does not allow the bounce message send to that account. Is it normal or is it a code error?
$verp = 'bounces-' . str_replace('#', '=', $row['ReplyTo']) . '#gmail.com';
$message = Swift_Message::newInstance()
->setSubject($row['Subject'])
->setFrom(array($row['ReplyTo'] => $row['FromName']))
->setReturnPath($verp)
->setBody($html, 'text/html')
->addPart($txt, 'text/plain');
I am now using VERP, it seems that it is to locate a delivery error? But not for sending the message to a bounce mail account?
Yes, that is normal. When sending email through Gmail's SMTP servers, it will force the return-path to be the account you are sending from.
Your only solution is to search for a provider which allows you to set the return-path.
It's not a gmail issue, it's a requirement of the SMTP specification, as defined in RFC 5321 section 4.4:
A message-originating SMTP system SHOULD NOT send a message that already contains a Return-path header field.
It also says that while SMTP systems should not inspect message content at all (i.e. they don't look at headers), a gateway from some other context to SMTP SHOULD remove any return-path header. In short, if you're adding a return-path header yourself, you're doing it wrong.
The return-path header you see in a received message is created by the receiver, not the sender, and is derived from the SMTP MAIL FROM command used to deliver the message. This address need not to have anything in common with the From address header within the message, and designates where the message should be sent to in the event of a delivery failure, i.e. exactly what you want the VERP address for.
I don't know about SwiftMailer, but in PHPMailer you can set the SMTP envelope sender value by setting the Sender property, and a receiver will convert that into a return-path message header on reception.

What e-mail header is needed for a message to be displayed as 'via:'?

I have noticed that some mails come with the from address like :
Adam Mannet via www.findyourfriend.com.
What headers do I need to pass to the native PHP mail() function to accomplish this when sending e-mail?
I think the via tag is added by the mail server when somebody uses an external (from his domain) smtp server.
Per example,
my email is iceduck#iceduck.net but I send email via Gmail's smtp, you will see From iceduck#iceduck.net via Gmail.com.
If you want to make the via appear then you'll have to send your mail through the smtp server you want to appear in the via.
You can check out this link : http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm
I don't think the solution is in the header.
Best
You should check PHP mail documentation. There is a description how to modify 'From' header. You should use additional_headers to change that header information and include 'friendly name' beside your e-mail address.
<?php
// The message
$message = "Message content";
$headers = 'From: User Name <user#example.com>';
// Send
mail('test#example.com', 'My Subject', $message, $headers);
?>
This should make your from address look like: 'User Name via www.example.com'

Categories