Email sending isssue
Elevenstech Jan 27, 2021
Please use this code to send email. This code is only work on Live server.
public function send()
{
$to = '[email protected]'; // User email pass here
$subject = 'Welcome To Elevenstech';
$from = '[email protected]'; // Pass here your mail id
$emailContent = '<!DOCTYPE><html><head></head><body><table width="600px" style="border:1px solid #cccccc;margin: auto;border-spacing:0;"><tr><td style="background:#000000;padding-left:3%"><h4 style="color: #fff;">Elevenstech Web Tutorials</h4></td></tr>';
$emailContent .='<tr><td style="height:20px"></td></tr>';
$emailContent .= 'This is testing'; // Post message available here
$emailContent .='<tr><td style="height:20px"></td></tr>';
$emailContent .= "<tr><td style='background:#000000;color: #999999;padding: 2%;text-align: center;font-size: 13px;'><p style='margin-top:1px;'><a href='http://elevenstechwebtutorials.com/' target='_blank' style='text-decoration:none;color: #60d2ff;'>www.elevenstechwebtutorials.com</a></p></td></tr></table></body></html>";
$config['protocol'] = 'sendmail';
$config['smtp_host'] = 'localhost';
$config['smtp_user'] = 'Enter Your real Gmail id'; //Important
$config['smtp_pass'] = 'Enter Your Password'; //Important
$config['smtp_port'] = 25;
$this->email->initialize($config);
$this->email->set_mailtype("html");
$this->email->from($from);
$this->email->to($to);
$this->email->subject($subject);
$this->email->message($emailContent);
$this->email->send();
echo'Email Send!';
}
Elevenstech Web Tutorials
Elevenstech Web Tutorials helps you learn coding skills and enhance your skills you want.
As part of Elevenstech's Blog, Elevenstech Web Tutorials contributes to our mission of “helping people learn coding online”.
Read More
Newsletter
Subscribe to get the latest updates from Elevenstech Web Tutorials and stay up to date