Welcome Guest, Not a member yet? Register   Sign In
Sending Email as HTML fails
#1

[eluser]skunkbad[/eluser]
I can send email. As soon as I set the mailtype to html, it fails. Doesn't matter if it is in a config file, or set in the controller, fails either way. This is on a shared hosting account (linux) on IX webhosting.

Message: mail(): Bad parameters to mail() function, mail not sent.
Filename: libraries/Email.php
Line Number: 1519

I use this same code on two other hosts with no problems:

Code:
$this->load->library('email');
$this->email->from( set_value('email') , set_value('realname') );
$this->email->to( '[email protected]' );
$this->email->subject('Website Contact Message ' . date("M j, Y"));
$built_message['realname'] = set_value('realname');
$built_message['email'] = set_value('email');
$built_message['mesg'] = nl2br(set_value('mesg'));
$this->email->message($this->load->view('contact_email', $built_message, TRUE));
$this->email->send();

If the mailtype is not set as html, it sends the email, and the html characters are visible, and look otherwise perfect. Driving me crazy.
#2

[eluser]skunkbad[/eluser]
I figured out my problem. The protocol should have been 'sendmail' instead of 'mail'. I only found this through trial and error, and it really took a lot more time than it should. Is there some easy way to determine if the protocol should be 'sendmail' vs. 'mail'?
#3

[eluser]Jeremy Gimbel - Conflux Group[/eluser]
It really depends on your server configuration. Depending how PHP is setup to handle mail and what mail server software is installed, this setting is determined.

jeremy
#4

[eluser]skunkbad[/eluser]
[quote author="jeremygimbel" date="1259649585"]It really depends on your server configuration. Depending how PHP is setup to handle mail and what mail server software is installed, this setting is determined.

jeremy[/quote]

At least for me, I tend to be working with clients who have shared hosting, so I was hoping for a simple way to just look and see what protocol to use, but it sounds like it may be complicated.
#5

[eluser]abmcr[/eluser]
I have the same problem of skunkbad.... do you have solved?
Thank you




Theme © iAndrew 2016 - Forum software by © MyBB