php - Email encoding with Amazon SES sendRawEmail -


I am trying to send the following raw e-mail message using PHPMailer 5.2.9 generated by SES SDK 2.7 sendRawEmail method:

  Date: Tuesday, 28 October 2014 03:34:18 from +0000: someemail@gmail.com- Reply: someemail@gmail.com Message-ID: & lt; C738074625a476ed8e2793323ad0b3b2 @ * Dev & gt; X-priority: 3X-Mailer: PHPMailer MIME-version: 1.0 Content-Type: Multipart / Optional; Border = "b1_c738074625a476ed8e2793323ad0b3b2" Material Transfer-Encoding: 8bit to: someperson@gmail.com subject: Test Subject (TID # 1, SID # 2) --b1_c738074625a476ed8e2793323ad0b3b2 Content-Type: text / plain; Test the email for Charset = us-ascii _Some One_! --b1_c738074625a476ed8e2793323ad0b3b2 Content Type: text / html; Charset = us-ascii & lt; I & gt; Some forests & lt; / I & gt; Test Email for! --b1_c738074625a476ed8e2793323ad0b3b2--  

Here's to the raw produce email and send him used to the code:

  $ mail = new PHPMailer ( ); $ Mail & gt; AddAddress (for $); $ Mail & gt; SetFrom (from $); $ Mail- & gt; Subject = $ theme; $ Mail- & gt; Charset = $ char_set; $ Mail- & gt; AltBody = $ text; $ Mail- & gt; Body = $ html; $ Mail & gt; IsHTML (true); $ Mail & gt; AddAttachment ($ attachment); $ Mail & gt; Presend (); $ Args = ['source' = & gt; From $, 'Destination' = & gt; [To $], 'romes' = & gt; ['Data' = & gt; $ Mail-> GetSentMIMEMessage ()]]; $ A vs = ovs \ common \ os :: factory (ap_path (). '/config/aws.php'); $ Ses = $ aws- & gt; Receive ('se'); $ Send_result = $ ses- & gt; Send RawEmail ($ Args); I have not received any error in  $ send_result , just a standard 'MessageId' and 'RequestId' would send me a successful (and it really ) 

I have tried well with and without attachments, but it still sends the message as a distorted mess. This is what has been received:

What am I doing wrong here?

You forgot to encode the data:

  'RawMessage' = & Gt; ['Data' = & gt; From Base64_encode ($ mail-> getSentMIMEMessage ())]  

To: ... - The content should be base-64-encoded, if MIME is required of it.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -