freelance84 Posted October 16, 2011 Share Posted October 16, 2011 I managed to get the ssmtp to forward on mail to my email host using ssmtp to my server on ubuntu 11.04 with help from Thorpe. In my previous thread (click here) on the topic i stated that the subject of the email was being "received" incorrect: This was actually false. The subject is being received correctly, however the mail is not being received as if from my email pop box, but instead as from 'www-data' Here is an example of one of the php scripts being used (which worked perfectly well before): $boundary = uniqid('np'); $to = "contact-us@mydomain.com"; $subject = "ContactUs Public Message"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "From: Contact Us Public Page <contact-us@mydomain.com>\r\n"; $headers .= "nReply-To: no-reply@mydomain.com\r\n"; $headers .= "Content-Type: multipart/alternative;boundary=" . $boundary . "\r\n"; $message = "\r\n\r\n--" . $boundary . "\r\n"; $message .= "Content-type: text/plain;charset=utf-8\r\n\r\n"; $message .= $msg_non_html; $message .= "\r\n\r\n--" . $boundary . "\r\n"; $message .= "Content-type: text/html;charset=utf-8\r\n\r\n"; $message .= $msg_html; $message .= "\r\n\r\n--" . $boundary . "--"; mail("$to", "$subject", "$message", "$headers"); What i am getting through in the email inbox is just the plain text version and nothing else (i get the same in outlook as i do hotmail inbox and yahoo mail) Content-type: text/plain;charset=utf-8 the rest of the plain text email When i right click to view the source of the email in outlook, i am getting both the plain text and html version through, but for some reason it is not being read correctly. This is an example of the source being recieved: Return-path: <www-data@mydomain.com> Envelope-to: contact-us@mydomain.com Delivery-date: Fri, 14 Oct 2011 15:41:58 +0100 Received: from [31.777.777.777] (helo=Svr01.mydomain.com) by serverX.bb-online.co.uk with esmtpa (Exim 4.69) (envelope-from <www-data@mydomain.com>) id 1REixR-000607-GC for contact-us@mydomain.com; Fri, 14 Oct 2011 15:41:58 +0100 Received: by Svr01.mydomain.com (sSMTP sendmail emulation); Fri, 14 Oct 2011 14:41:57 +0000 From: "www-data" <www-data@mydomain.com> Date: Fri, 14 Oct 2011 14:41:57 +0000 To: contact-us@mydomain.com Subject: ContactUs Public Message X-PHP-Originating-Script: 1002:email_contact_us_public.php MIME-Version: 1.0 nReply-To: no-reply@mydomain.com Content-Type: multipart/alternative;boundary=np4e984a350db71 X-Antivirus: avast! (VPS 111014-0, 14/10/2011), Inbound message X-Antivirus-Status: Clean --np4e984a350db71 Content-type: text/plain;charset=utf-8 The plan text email --np4e984a350db71 Content-type: text/html;charset=utf-8 The html version of the email --np4e984a350db71-- I can only assume this is an issue to do with my server only giving the email to another server which will post the mail on my behalf, or that i have missed a small ssmtp config line somewhere... Does anyone have any idea? Quote Link to comment https://forums.phpfreaks.com/topic/249210-correcting-the-name-of-the-sender-from-ssmtp/ Share on other sites More sharing options...
freelance84 Posted October 16, 2011 Author Share Posted October 16, 2011 Ok, well without actually doing anything, the emails sent are now being received with the correct name in the 'from section'.... but I did not do anything to make it so... it just happened. The email it self will still only show the non-html version though.... ??? The headers have changed a little: Return-path: <accounts@mydomain.com> Envelope-to: john@recipientemail.com Delivery-date: Sun, 16 Oct 2011 16:46:26 +0100 Received: from [10.3.1.1] (helo=serverYY.bb-online.co.uk ident=hidden-user) by serverX.bb-online.co.uk with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from <accounts@mydomain.com>) id 1RFSuw-0002oz-1Y for john@recipientemail.com; Sun, 16 Oct 2011 16:46:26 +0100 Received: from [31.222.189.203] (helo=Svr01.mydomain.com) by serverYY.bb-online.co.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from <accounts@mydomain.com>) id 1RFSuu-0003QS-UP for john@recipientemail.com; Sun, 16 Oct 2011 16:46:25 +0100 Received: by Svr01.mydomain.com (sSMTP sendmail emulation); Sun, 16 Oct 2011 15:46:27 +0000 Date: Sun, 16 Oct 2011 15:46:27 +0000 To: john@recipientemail.com Subject: Private Message X-PHP-Originating-Script: 1002:email_private_message.php MIME-Version: 1.0 From: DeRep <accounts@mydomain.com> nReply-To: no-reply@mydomain.com Content-Type: multipart/alternative;boundary=np4e9afc5378843 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - serverYY.bb-online.co.uk X-AntiAbuse: Original Domain - recipientemail.com X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - mydomain.com X-Antivirus: avast! (VPS 111016-0, 16/10/2011), Inbound message X-Antivirus-Status: Clean If anyone has any ideas, i'm all ears but if i do find a solution beforehand I will post to solve this thread. (the only thing remaining is the html and non-html issue) Quote Link to comment https://forums.phpfreaks.com/topic/249210-correcting-the-name-of-the-sender-from-ssmtp/#findComment-1279750 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.