xample#gmail.com
X-CMAE-Envelope: MS4wfP8FXd8/R+a/LSU6TL5fZ2U9j6XNOlqH2ChNeZRC9M65GyLWs79yxh/WSVP1mWgmTrSR1jubA85EorlFhPmvIANJv+g8Dvba+4+i5Epzjt6Q3cuOetV2
yQT63E6PAR3l9SpC0BsxP9MXrvBLXdYDMIrGANJWNZNOR8b5focPdjP4
[Mail Message]
Whenever I send a mail using PHP, X-CMAE-Envelope is automatically adding in mail body. How can I remove it?
It has been a while ago since this was asked, but if someone else gets the same problem:
I noticed that the envelope message disappears when you start the message body with an extra empty line.
\r\n\r\n Marks the end of the headers and start of the message body.
CMAE stands for Cloudmark Authority Engine and is an e-mail security product (anti-spam). This and others headers are added by this software at a server level. You should check it with your sysadmin.
https://www.cloudmark.com/en/knowledgebase/cloudmark-authority-for-spamassassin/Order-of-startup-for--CMAE-spamd-and-the-MTA
This is not a direct answer, but I didn't find much on the web for this.
While using Python sending an email through gmail to a user#vzpix.com email, it appears the message included the X-CMAE-Envelope based on what the message was. If the message was not only text but included a date and time - then it included the X-CMAE-Envelope otherwise it was not included. With that being said, it appears server-based.
I know this was from a while ago but I recently had the same issue, specifically a colon ":" triggers this. But if you just start your message with \n it fixes it
Related
I've connected PHPMailer to my register system and once a user registers it auto-sends a email to the registered user, now I'm having a issue while attempting to set a new line while sending the email:
"Hello, ".$formvars['name']."<br>".
"Thank you for your registration with us and trusting us with your user account!"."<br>".
"If any problems arrise with logging into your account or using it, please adress this email."."<br>".
"\n".
"Kind Regards."."<br>".
"Auto-Bot!"."<br>";
I don't really see why it wouldn't make a new line properly, the \n or \r\n don't show in the email but also don't make a new line.
UPDATE:
Apologize for not providing enough code, the issue was that I called isHTML and tried to do that, I changed the lines to split up using
At a guess (because you didn't post your code), you're probably sending plain text as HTML, and HTML will ignore line breaks, so omit this line from your code:
$mail->isHTML();
If you want to use HTML, you can use HTML tags such as <p> and <br> to break up your text.
I just want to ask because I tried to send an email with a link. The problem is the link.
http://mysite/samplesite/login/confirm_email/qwVBEkXFqCp9BQLvKWNBPpWzOo2Ryx
becomes
http://mysite/samplesite/login/confirm_email/qwVBEkXFqCp=BQLvKWNBPpWzOo2Ryx
As you notice, the 9 became =.
I tried changing my mailtype as text and it work but how to solve it having mailtype as html?
I use the PHP Mailer for send email... Thats already makes the necessary settings for authentication and integrity of your email code in html. Always works for me.
Download PHPMailer: http://sourceforge.net/projects/phpmailer/
How to use: http://phpmailer.worxware.com/
I'm using modMail class to send custom emails. I have followed the guidelines on MODX site and used the following code which I placed in a snippet:
$message = $modx->getChunk('myEmailTemplate');
$modx->getService('mail', 'mail.modPHPMailer');
$modx->mail->set(modMail::MAIL_BODY,$message);
$modx->mail->set(modMail::MAIL_FROM,'me#example.org');
$modx->mail->set(modMail::MAIL_FROM_NAME,'Johnny Tester');
$modx->mail->set(modMail::MAIL_SUBJECT,'Check out my new email template!');
$modx->mail->address('to','user#example.com');
$modx->mail->address('reply-to','me#xexample.org');
$modx->mail->setHTML(true);
if (!$modx->mail->send()) {
$modx->log(modX::LOG_LEVEL_ERROR,'An error occurred while trying to send the email: '.$modx->mail->mailer->ErrorInfo);
}
$modx->mail->reset();
The snippet has been modified to contain message from custom chunk as well as email addresses have been replaced with the correct ones. The snippet sent email once and never again. I have no idea what causes such behavior which prevents it from sending emails.
I have read that using the reset function $modx->mail->reset(); resets email fields and allows the email to be sent again yet I have a feeling that it causes problem here.
The snippet is called uncached on the page [[!email]]
Does anyone have an idea why the emails are not being sent, even though it worked once?
if there is an error in your chunk or in processing your chunk, modx is never going to get to thepoint where it logs an error. try something like:
if (!$modx->mail->send()) {
$modx->log(modX::LOG_LEVEL_ERROR,'An error occurred while trying to send the email: '.$modx->mail->mailer->ErrorInfo);
}else{
$modx->log(modX::LOG_LEVEL_ERROR,'This mail was sent: '.$message);
}
to see if it logs something. but otherwise what you have there is exactly correct - try to take the $message variable out and send just a string. if it sent mail once, then something else must be wrong. I'd start looking at mail server logs, headers, spam [gmail??] etc.
Using this tut: parse emails
I was able to get email piping, and attachment/body parsing totally working....as long as the email is not sent from outlook.
It executes perfectly from gmail, and thunderbird, however when the incoming email is sent from outlook the script fails. I figure it has something to do with how outlook formats its messages (in the comments on the tutorial site someone mentions outlook not being compliant), but truthfully the issue is above my head. Any help would be appreciated, thanks.
fyi: this is the newest version of outlook (win7).
As you have encountered, Outlook is the scourge of the email universe. You'll notice that the source provided in the tutorial you're using refers several times to content encoded as text/plain. The email being sent from Outlook likely contains text/html content instead of or in addition to the plaintext.
Depending on what you wish to do with the content of the email, you may be able to adapt the script to accept text/html encoded content as well by inserting a duplicate body search below the existing one like so:
//get the message body
if(substr($decoded[0]['Headers']['content-type:'],0,strlen('text/html')) == 'text/html' && isset($decoded[0]['Body'])){
$body = $decoded[0]['Body'];
} elseif(substr($decoded[0]['Parts'][0]['Headers']['content-type:'],0,strlen('text/html')) == 'text/html' && isset($decoded[0]['Parts'][0]['Body'])) {
$body = $decoded[0]['Parts'][0]['Body'];
} elseif(substr($decoded[0]['Parts'][0]['Parts'][0]['Headers']['content-type:'],0,strlen('text/html')) == 'text/html' && isset($decoded[0]['Parts'][0]['Parts'][0]['Body'])) {
$body = $decoded[0]['Parts'][0]['Parts'][0]['Body'];
}
Which certainly isn't pretty, but should retrieve the HTML content coming from Outlook if it is detected.
If you need to actually parse the HTML content, your problem will be a bit more complicated. Your next step would be to take a look at some of the answers for this question: Robust, Mature HTML Parser for PHP.
Good luck!
Ok...
So I fixed it. I was setting up the pipe in Cpanel, because it's easier. I put the pipe under "account level filtering", worked great for anything but outlook. I would have loved to have the script print data for debug, but it was never even executing when the email came from outlook. Looked in mail logs...nothing obvious. My admin on a whim suggested that I move the pipe to the "forwarders" section in cpanel. Well now it works perfect. Must be a bug in cpanel. Why is it the more you learn about computers the less sense they make.
Just a couple other tweaks I had to implement:
A) when writing/editing the script in a windows environment, hidden characters are added. To fix this, I upload the php file, and open it in the cpanel filemanager (us-ascii), and save it. This removes the characters. (could obviously open in *nix also)
B) I had to chmod to 755, or it would not run. Scripts sitting outside my \www so no worries.
C) My shebang had to be: #!/usr/bin/php -q. The q was necessary to get it running.
Hope this helps someone else.
I want to create a script in php to read al mail from a mail acount. I connect to the server, I can see the mails but went I want to seet it back to unseen I can't find a function to do this.
If I understand this page correctly:
http://www.php.net/manual/en/function.imap-body.php
You can use the FT_PEEK option to leave the message as 'unread'.
EDIT AFTER YOUR COMMENTS
Have you looked at this method?:
http://www.php.net/manual/en/function.imap-clearflag-full.php
You are able to clear the \\Seen flag.