homepage Welcome to WebmasterWorld Guest from 54.167.173.250
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

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
matthewamzn




msg:4001364
 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:

http://www.example.com/files/thumbs/151_32_wYHGFcibTh.JPG

turns to this in the email:

http://www.example.com/files/thumbs/151_32_wYHGFcibTh.J!%20PG

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]

 

andrewsmd




msg:4001728
 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.

TheMadScientist




msg:4002046
 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