• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
EMAIL CLASS Cannot send email


I am stumped. I am trying to send an email with the email class with no success. I have tried both SMTP and SENDMAIL and I know I am doing SOMETHING wrong but I don't know what.

My code is this:

PHP Code:
public function emailtest(){
//Now the code to send the email
$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/lib/sendmail -t -i';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config["smtp_host"] = "localhost";
$config["smtp_user"] = "email@mydomain.org";
$config["smtp_pass"] = "somepass";
$config["smtp_port"] = 587;
$config["mailtype"] = "text";
$config["crlf"] = "\n";
$config["newline"] = "\n";
//$emailText = "This is a test";
$emailText "This is the text of an email";
mail("secondemail@gmail.com","This is a test""This is the message""From: webmaster@example.com");
"<h1>The email was sent</h1>";

Now, the email class doesn't work. However, the standard mail() call seems to work perfectly. Any idea what I am doing wrong here?

Thanks in advance for your assistance.

Your smtp needs to be setuo in your php.ini file, I use my comcast account for this.

As far as sendmail it also has to be setup.

Here is an application for Windows that will test your mail settings for you.

Test Mail Server Tool
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.