homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Image URL broken during mail

10+ Year Member

Msg#: 4001362 posted 12:51 pm on Oct 5, 2009 (gmt 0)

When I send an email newsletter, everything looks good except often one image will be broken. Here's an example:


turns to this in the email:


Can I protect it from being altered? What's causing !%20 being added?

This is my mail method:
public static function send_html($to, $from, $reply_to, $subject, $message) {
$headers = "From: " . $from . "\r\n";
$headers .= "Reply-To: ". $reply_to . "\r\n";
//$headers .= "CC: " . $cc . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
mail($to, $subject, $message, $headers);

[edited by: eelixduppy at 4:01 pm (utc) on Oct. 5, 2009]
[edit reason] switched to example.com [/edit]



WebmasterWorld Senior Member 5+ Year Member

Msg#: 4001362 posted 8:50 pm on Oct 5, 2009 (gmt 0)

Where is your message getting created? Try doing a var_dump on your message at the beginning of the function you posted, and see if it is what it is supposed to be. Then you know it is a problem with the mail function and not your code.


WebmasterWorld Senior Member themadscientist us a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

Msg#: 4001362 posted 11:28 am on Oct 6, 2009 (gmt 0)

andrewsmd has a good idea, also here are a couple of questions:

Is the img url the only thing on the line in the compilation of the $message (IOW: \nhttp://www.example.com/files/thumbs/151_32_wYHGFcibTh.JPG\n) and are you using wordwrap()?

Your mail function looks fine.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved