Welcome to WebmasterWorld Guest from 54.221.87.97

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Image URL broken during mail

     

matthewamzn

12:51 pm on Oct 5, 2009 (gmt 0)

10+ Year Member



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

8:50 pm on Oct 5, 2009 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



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

11:28 am on Oct 6, 2009 (gmt 0)

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



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.