Pathik Vejani
Pathik Vejani

Reputation: 4501

postfix send email subject breaks the FROM

I am using postfix to send an email to the user, but the problem is it breaks the words where it finds the space. Here is the screenshot: postfix-send-email

enter image description here PHP code to send an email:

<?php
$subject = "Status Of mail";
$message = "Test Email using Postfix Apache2";
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: 'The Travel Worthy' '[email protected]"\r\n";
$send = mail('[email protected]', $subject, $message, $headers);
if($send)
{
    return 1;
}
else
{
    return 0;
}
?>

Upvotes: 0

Views: 124

Answers (1)

Nabeel
Nabeel

Reputation: 183

Try replacing

$headers .= 'From: 'The Travel Worthy' '[email protected]"\r\n";

with

$headers .= "From: The Travel Worthy <[email protected]>\r\n";

Upvotes: 1

Related Questions