blastbum Posted August 26, 2011 Share Posted August 26, 2011 Hi, For some weird reason I am getting strange characters such as ï¿∏ appearing in emails sent out from a website my company has just developed. The script that is sending the email is the following: <?php $to = $email; // atención a la coma $subject = 'Client Registration - Xxxx Xxxxxxxxxx'; $message = 'Dear '.$first_name.',<br> <br> We recently sent you an email to announce our new website with particular reference to your financial and classing data statements.<br> <br> Our website has information about the XXXXX Group, our contact details, including our regional Agents, market and price information, along with your personal financial documents such as Recipient Created Tax Invoices and Classing Data.<br> <br> By providing this information on-line, you will be able to access your personal information relating to business with Xxxxx more efficiently. However, if you would like to receive your statements via an alternative method, please don’t hesitate to contact us.<br> <br> This email is to confirm that you now have access to the section of our new website.<br> <br> Your details are:<br> Your Email: '.$email.'<br> Your Username: '.$username.'<br> Your Password: '.$password.'<br> <br> Please keep these details safe as they provide direct access to your personal information. If you have any questions or issues accessing our site or your information, please contact me directly. Thank you for your business and we hope we can continue our commercial relationship going forward.<br> <br> Yours Sincerely,<br> Joe Bloggs<br> Director<br> <br> 15 Sample Street | Sample City<br> Tel: +xx xxxx xxxxx | Mobile: +xx xxxx xxxxx | Fax: +xx xxxxx xxxxxx<br> Email: xxxx@xxxxxxxx.com Web: http://www.xxxxxxxx.com/ '; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; //$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n"; $headers .= 'From: Sample Company <xxxx@xxxxxxxxxx.com>' . "\r\n"; //$headers .= 'Cc: birthdayarchive@example.com' . "\r\n"; $headers .= 'Reply-To: xxxx@xxxxxxxxxx.com' . "\r\n"; // Mail it if (@mail($to, $subject, $message, $headers)){ $_SESSION['msg'] .= 'Email Sent to the new client.'; } else { $_SESSION['msg'] .= 'Email Failed.'; } ?> Can anybody see why these strange ï¿∏ characters are appearing? Many thanks for your help. Dan Quote Link to comment Share on other sites More sharing options...
teynon Posted August 26, 2011 Share Posted August 26, 2011 $to = $email; // atención a la coma Looks like you guys copy and pasted someone elses script. Anyways, where are the characters appearing? Have you tried removing the headers? Quote Link to comment Share on other sites More sharing options...
blastbum Posted August 26, 2011 Author Share Posted August 26, 2011 Hi, Thanks for your reply. See the below email to see where the characters are appearing: Dear Xxxxxx, We recently sent you an emailï¿∏to announce our new websiteï¿∏with particular reference to your financial and classingï¿∏dataï¿∏statements. Our website has information about the Xxxxx Group, our contactï¿∏details, including our regionalï¿∏Agents, market and price information, along with your personal financial documents such asï¿∏Recipient Created Tax Invoices and Classing Data. By providing this information on-line,ï¿∏you will be able to access your personal informationï¿∏relating to business with Xxxxxxï¿∏more efficiently. However, if you would like to receive your statements via an alternative method, pleaseï¿∏donï¿∏t hesitate to contact us. This email is to confirm that you now have access to the section of our new website. Your details are: Your Email: xxxx@xxxxxxxx.com <mailto:xxxx@xxxxxxxx.com> Your Username: xxxx@xxxxxxxx.com <mailto:xxxx@xxxxxxxx.com> Your Password: xxxxxxxxx Please keep these details safeï¿∏as they provideï¿∏direct access to your personal information. If you have any questions or issues accessing our site or your information, please contact meï¿∏directly. Thank you for your business and we hope we can continue our commercial relationship going forward. Yours Sincerely, Joe Bloggs Director 15 Sample Street | Sample City Tel: +xx xxxx xxxxxï¿∏| Mobile:ï¿∏+xx xxxx xxxxx | Fax: +xx xxxx xxxxx Email:ï¿∏xxxx@xxxxxxxx.com Web: http://www.xxxxxxxx.com/ Any ideas anybody? Quote Link to comment Share on other sites More sharing options...
possien Posted August 26, 2011 Share Posted August 26, 2011 What are you using for your HTML editor? How are you viewing the email, web browser or email program? They appear to be close to a byte order mark (google BOM). Quote Link to comment Share on other sites More sharing options...
blastbum Posted August 26, 2011 Author Share Posted August 26, 2011 Hi. I'm using Adobe Dreamweaver CS4 as my HTML editor and I'm viewing the email with Microsoft Entourage. However, that said, it was my client who brought this to my attention and he uses a PC. If anyone else could shed more light on this issue I would greatly appreciate it. Thanks. Dan Quote Link to comment Share on other sites More sharing options...
teynon Posted August 26, 2011 Share Posted August 26, 2011 Dan, please upload the php file directly into this form using the attach feature below the textbox. Quote Link to comment Share on other sites More sharing options...
possien Posted August 27, 2011 Share Posted August 27, 2011 Not knowing what your session variable does, I changed your code to this and it works fine. I ran into a header problem with Dreamweaver adding those characters at the beginning of the file but not viewable in Dreamweaver but visible in Notepad. I found empty lines at the beginning of the file caused it. if (@mail($to, $subject, $message, $headers)){ echo "Mail Sent"; } else { "Mail Not Sent"; } Quote Link to comment 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.