Email Error: missing or malformed local part - email

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

=?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.

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

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#example.com>";
$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: "email1#example.com, email2#example.com" other than that: 'String' with single quotes no error will produce...

Related

Can you use part of the email subject to populate the To field in the Email Outbound Point in mule?

I have an Email to Email flow that needs to send specific senders depending on the email subject. I was using #[message.inboundProperties.subject.substring(40,3) to get the value but its ending up in error. I'm not sure which function to use to get the value I need from the subject since the order number is also there. Any tips? All my needed values are on the subject line at the moment.
Also, Can I use this value to generate an email body for the message?
To: [Sender]
Hi [Sender]
Your order no [Order] was successfully imported
Thanks Mule
The first question that comes to mind is from where are you getting the Subject ? Is it a Fixed statement ?
What you can do is other way round. You can store the [Order] and [Sender] in flow variables and then you can construct a Subject line and email body out of it.
For example let you store your [Order] in a flow variable as follows:-
<set-variable variableName="Order" value="#[message.inboundProperties.'order']" doc:name="Variable"/>
and [Sender] in another flow variable :-
<set-variable variableName="Sender" value="someone#example.com" doc:name="Variable"/>
Then you can send [Order] and [Sender] in subject line :-
Hi #[flowVars.Sender.split('#')[0]] your order number #[flowVars.Order] is ready
And in email body you can write as following :-
Hi #[flowVars.Sender.split('#')[0]]
Your order no#[flowVars.Order] was successfully imported
Thanks Mule
Please note I have used flowVars.Sender.split('#')[0] to get the sender name from email address ...
reference :- How can I extract the user name from an email address using javascript?

Magento invalid email address

I'm trying to add my email address in Store Email Address, But it is saying "Invalid email address "admin#mydomain"."
Note that my tld is uncommon.
I think that is the reason for the error message.
I can add .com email address easily btw.
Is there any way to add the email?
Thank you.
in validation.js you have
['validate-email', 'Please enter a valid email address. For example johndoe#domain.com.', function (v) {
return Validation.get('IsEmpty').test(v) || /^([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*#([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*\.(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,})$/i.test(v)
}],
You will have to play with this regular expression.
if you look into this expression you will find a . jsut remove every thing excluding ] from . till end and should solve.
I had the same issue, but your suggestions were misleading.
The error message comes up not from this java script, but app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Email/Address.php
The error is generated from lib/Zend/Validate/EmailAddress.php, because it calls hostname verification from Hostname.php in the same directory.
There you can find in row nr. 117 an array called $_validTlds
there put your domain ('works' or in my case 'wien'), take care alphabetical order, and quotes and commas. save and try again,
it will work. Good luck.

"Illegal address in String" email template in CQ5 javax.mail

Working on a customised email template in CQ5, I have created in following text file under etc/notification. The workflow is triggered when a form is filled in by the user.
From: Order Brochure <order.brochures#gmail.com>
To: ${payload.email}
CC:
Subject: Order Brochures Confirmation ${payload.BrochureID}
Dear ${payload.Name},
Thank you for your Brochure Order, your reference is ${payload.orderBrochureID}.
Your email address is {$payload.email}.
Everything in this template works fine, except for the "To: ${payload.email}". Even the "Your email address is {$payload.email}" part displays the user inputted email fine. It also works if I input a static email address in "To:".
What am I doing wrong here? Below is the error in logs
Process execution resulted in an error:
javax.mail.internet.AddressException: Illegal address in string ``''
com.day.cq.workflow.WorkflowException: javax.mail.internet.AddressException: Illegal
address in string ``''
Remove the "CC:" it's attempting to parse the email address for this header and it's a null.
When you're dealing with these types of problems when the error is occurring within a CQ library. I recommend using a custom logger to assist with the troubleshooting.
Details of logging can be found at Logging - docs.day.com
Here's an example OSGi log configuration for your issue.
This error might be cumming because you are using a string as an Internet Address.
you need to typecast ${payload.email} to Internet Address.

Postfix Perl mailing via PostDrop

I'm trying to inject an email directly into the postfix queue using a perl module Mail::Postfix::Postdrop which ultilises a postfix method of allowing messages to be written directly to the postdrop directory.
There is a small amount of documentation which has enabled me to send a message successfully, however, I am confused to how I am able to set a subject and message body. An attempt to set the variable $message does little to nothing.
I must admit, I'm an apprentice to Perl at best, I would appreciate any help.
#Code which successfully sends an email:
use Mail::Postfix::Postdrop 'inject';
$message = 'test message';
inject $message, Sender => 'postmaster#mydomain.com',
Recipients => [ qw(email#someotherdomain.com) ];
Some relavant documentation:
http://annocpan.org/~PMAKHOLM/Mail-Postfix-Postdrop-0.3/lib/Mail/Postfix/Postdrop.pm
In email messages "headers" section is separated from "body" section by empty line. Just change your $message to:
$message = "Subject: This is my subject!\n\nAnd this is my message";
and you should see that you've set subject and message text. Note "\n\n", which creates empty line (double quotes are used to allow \n interpolation in $message).
Note that Mail::Postfix::Postdrop claims it accepts Email::Abstract object as a message, so you might consider using Email::Simple (or other Email::Abstract supporting class) to create your messages.

sendmailR: Submit encoded message to local SMTP server

I need your help in order to send email message that includes text in Greek, from within R, using the function sendmail {sendmailR}.
I tried using the function iconv, like that but it didn't work
subject <- iconv("text in greek", to = "CP1253")
sendmail(from, to, subject, msg, control=list(smtpServer="blabla"))
The mail arrives immediately but the greek characters are unreadable. Any ideas?
EDIT
Another question that came up:
The second argument to accepts one recipient. What if want to send it to more than one? (I think 'll try sapply ing the sendmail function to a vector of recipients) - Ok, that worked. However, I'm not completely satisfied because each one of the recipients has no way to know who else has received the message.
Mail client won't be able to understand any encoding without Content-Type: charset=..., so you must add it:
msg<-iconv("text in greek", to = "utf8");
sendmail(from, to, subject, msg,
control=list(smtpServer="blabla"),
headers=list("Content-Type"="text/plain; charset=UTF-8; format=flowed")
);
that is for UTF8 (which I believe should be used), for CP1253:
msg<-iconv("text in greek", to = "CP1253");
sendmail(from, to, subject, msg,
control=list(smtpServer="blabla"),
headers=list("Content-Type"="text/plain; charset=CP1253; format=flowed")
);
multisend by hidden copies can also be done with header magick, still I think sapply loop is a better idea -- then the user will see that the mail was send directly to her/himself.