tags:

views:

27

answers:

0

I'm using pear mail and pear mail mime to send UTF8 HTML emails.

When I input urls such as //www.site.com.img they appear in the email as http:///www.site.com.img (note the three slashes).

Anyone know how to use //www urls with pear-mail/mime ?

To duplicate you can use the following code (taken from here) with change

<?php
require_once 'Mail.php';
require_once 'Mail\mime.php';

$message = new Mail_mime();

$text = 'Hello this is the Plain email';
$html = '<b>Hello</b>  <img src="//www.site.com/img.src"/><hr />This is the HTML email.';

$message->setTXTBody($text);
$message->setHTMLBody($html);

$body = $message->get();

$extraheaders = array('From' => '[email protected]', 'Subject' => 'Subject');

$headers = $message->headers($extraheaders);
$mail    = Mail::factory('mail');
$mail->send('[email protected]', $headers, $body);
?>

You will see the image as http:///www.site.com/img.src