Welcome Guest, Not a member yet? Register   Sign In
Sending email from gmail
#1

I'm trying to send an email from my gmail account to some other gmail address. But my code doesn't seem to work at all.

PHP Code:
$config = array(
"protocol"  => "smtp",
"smtp_host" => "smtp.gmail.com",
"smtp_user" => "xxxx@xxxx",
"smtp_pass" => "xxxxxxxx",
"smtp_port" => 587,
"smtp_crypto"=> "tls"
);

$this->load->library("email");
//$this->load->library('encryption'); 
$this->email->initialize($config);

$this->email->from("xxxx@xxxx");
$this->email->to("[email protected]");
$this->email->message("Hello");
$this->email->subject("Test");
$this->email->send(); 

I have allowed less secure apps to access gmail. Also I'm executing this script on local computer. My PHP version is 7.2.11. Codeigniter version is 3.1.10
Reply


Messages In This Thread
Sending email from gmail - by hmvartak - 02-16-2020, 03:03 AM
RE: Sending email from gmail - by jreklund - 02-16-2020, 03:34 AM
RE: Sending email from gmail - by hmvartak - 02-16-2020, 04:28 AM
RE: Sending email from gmail - by InsiteFX - 02-16-2020, 04:37 AM
RE: Sending email from gmail - by hmvartak - 02-16-2020, 06:29 AM
RE: Sending email from gmail - by Corsari - 04-04-2021, 12:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB