Welcome Guest, Not a member yet? Register   Sign In
HTML Email Fails when Mailtype is set
#1

[eluser]bafadam[/eluser]
I can send a text e-mail just fine, but when I try and initialize the html setting for the e-mail, I get a bunch of errors.

Here's the code that doesn't work, though if you remove the third line, it works just fine (obviously when the message and all that other stuff is set.

Code:
$this->load->library('email');
$this->email->set_newline("\r\n");
$this->email->initialize(array('mailtype' => 'html'));

It tosses out this:
A PHP Error was encountered

Severity: Warning

Message: mail() [function.mail]: Bad parameters to mail() function, mail not sent.

Filename: libraries/Email.php

Line Number: 1519
#2

[eluser]skunkbad[/eluser]
[quote author="bafadam" date="1260051424"]I can send a text e-mail just fine, but when I try and initialize the html setting for the e-mail, I get a bunch of errors.

Here's the code that doesn't work, though if you remove the third line, it works just fine (obviously when the message and all that other stuff is set.

Code:
$this->load->library('email');
$this->email->set_newline("\r\n");
$this->email->initialize(array('mailtype' => 'html'));

It tosses out this:
A PHP Error was encountered

Severity: Warning

Message: mail() [function.mail]: Bad parameters to mail() function, mail not sent.

Filename: libraries/Email.php

Line Number: 1519[/quote]

I just had this exact same problem last week! I changed the mail protocol from 'mail' to 'sendmail', and then everything worked perfectly.
#3

[eluser]Unknown[/eluser]
Same problem with "smtp" protocol :/
#4

[eluser]Sbioko[/eluser]
Can you provide the text you want to send?
#5

[eluser]novice32[/eluser]
When I use
Code:
$this->email->initialize(array('mailtype' => 'html'));
, I receive in my Gmail an empty content email with a "noname" attachment. The attachments contains the the content, unformatted. I tried both sendmail and smtp protocol.
#6

[eluser]cahva[/eluser]
When are you initializing? Remember that initialize also sets from, to etc. to blank so the initialization should be made before setting any of those parameters.
#7

[eluser]novice32[/eluser]
I have email.php under my config folder, so no initializing required. Although I have mailtype set to html, it receive emails with nonmame attachment.. that why I tried using
Code:
$this->email->initialize(array('mailtype' => 'html'));
I started another thread with this issue: http://ellislab.com/forums/viewthread/151416/
#8

[eluser]ericbae[/eluser]
Just like skunkbad did, it worked for me when I changed from mail to sendmail.

It's strange because "mail" protocol was working fine, until a few days ago. Maybe my hosting server changed some settings?




Theme © iAndrew 2016 - Forum software by © MyBB