Email Error: missing or malformed local part

12.6k Views Asked by At

I am noticing that I get an email from my server each time an order is placed. It looks like the customer confirmation emails are not sending.

This is part of the error message:

A message that you sent contained one or more recipient addresses that were
incorrectly constructed:

=?utf-8?B?R3Vlc3Q=?= <>: missing or malformed local part

This address has been ignored. The other addresses in the message were
syntactically valid and have been passed on for an attempt at delivery.

------ This is a copy of your message, including all the headers. ------

To: =?utf-8?B?R3Vlc3Q=?= <>
Subject: =?utf-8?B?SW50ZWxsaWdlbnQgV29ya3Nob3A6IE5ldyBPcmRlciAjIDEwMDAwMDAzMA==?=

It looks like it’s only when the user checks out without registering

3

There are 3 best solutions below

0
On

The email address is not written in proper format, please use <>

0
On
=?utf-8?B?R3Vlc3Q=?= <>: missing or malformed local part

The error message is quite obvious: There should be an email address between <>, but there is none. The local part is the part of the address before the @, and as there is nothing at all here, there is no local part. Thus your server is complaining.

You have to fix whatever application is trying to send mails to <> to get rid of the error.

1
On

I really don't Understand what you are trying to do. But This is what I found out playing around with this error.

$to          = "'Name of Person' <[email protected]>";
$headers     = "From: ".$_POST['theirName']."<".$_POST['theirEmail'].">\r\n";

$subject     = $_POST['subject'];
$messageBody = $_POST['message']."\r\n ---\n This Message was sent from ".HOME." contact form.";

mail($to,$subject,$messageBody,$headers);

Notice that around the 'Name of Person' has single quotes. If you are trying to send emails with an additional name, title or anything else in front of the emails. With the single quotes will let PHP know that it is not an email but a string, and it will add the string but be ignored as an email, not giving you the error anymore.

The header where it states from does not need to have the single quotes.

=?utf-8?B?R3Vlc3Q=?= <-This line I don't know what it supposed to be doing.

But it's not an Email on the $to/$recipient and for that reason it giving the error. Once again, must have only emails: "[email protected], [email protected]" other than that: 'String' with single quotes no error will produce...