Part of the EllisLab Network

Bug Report

Email class cannot send HTML emails to Yahoo addresses

Date: 05/24/2007 Severity: Major
Status: Resolved Reporter: sophistry
Version: 1.5.3
Keywords: Libraries, Email Class
Forum Thread: http://codeigniter.com/forums/viewthread/49097/

Description

Precis - I categorized this bug as Major because Yahoo mail has an estimated 250 Million users worldwide. (see this page comparing email services: http://www.techcrunch.com/2006/11/09/single-ajax-interface-for-yahoo-mail-im-coming/ )

When you try to send HTML email to a Yahoo address the email comes through fine, but it is blank. I have tested this behavior on the old-style Yahoo mail interface.

There has been discussion of this on the forums here:
http://codeigniter.com/forums/viewthread/49097/

and a simple fix involving changing the encoding proposed here:
http://codeigniter.com/forums/viewthread/47129/

After I applied the fix, emails were sent properly to Yahoo mail addresses. It seems the problem is with the encoding of the HTML part of the email message.

I checked the SVN today and the buggy line is still there. I have not tested whether the proposed fix affects all of the other email services (there are many), but it didn’t spoil the ones I’ve tested.

Code Sample

Using standard email class:

$this->load->library('email');
$config['useragent'] = 'My_Cool_CI_Mailer';
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'example.com';
$config['smtp_user'] = 'u';
$config['smtp_pass'] = 'p';
$config['mailtype'] = 'html';

$this->email->initialize($config);

$to_address = 'you@yahoo.com';
$from_address = 'me@example.com';
$from_name = 'ME';
$body = 'Hello';    
$subject = 'Subject_Here';


$this->email->to($to_address);
$this->email->from($from_address, $from_name);
$this->email->subject($subject);
$this->email->message($body);

$this->email->send();

Expected Result

A full email in the user’s yahoo account.

Actual Result

An blank email in Yahoo user’s account.

Comment on Bug Report

Page 1 of 1 pages
Posted by: sophistry on 24 May 2007 12:51pm
sophistry's avatar

Um, next to the Bug Tracker code submission field, it should say “Code put into this field will be automatically colorized - do not use blocks”

Now, it’s posted and I can’t fix it…. please, oh great bug fixer in the sky, come down and renew my code.

Posted by: Derek Allard on 24 May 2007 1:02pm
Derek Allard's avatar

Fixed up the code submission sophistry, thanks for reporting.

Name:

Email:

Location:

URL:

Remember my personal information

Notify me of follow-up comments?