this not work online in the amazon EC2 but in local work fine. And in the EC2 config security group view image:
config EC2 security group
My config controller is:
function SendEmail($Encabezado,$Nota){
$ci = get_instance();
$ci->load->library('email');
$config['protocol'] = "smtp";
$config['smtp_host'] = "ssl://smtp.gmail.com";
$config['smtp_port'] = "465";
$config['smtp_user'] = "mygmail#gmail.com";
$config['smtp_pass'] = "mypass";
$config['charset'] = "utf-8";
$config['mailtype'] = "html";
$config['wordwrap'] = TRUE;
$config['newline'] = "\r\n";
$ci->email->initialize($config);
$ci->email->from('mygmail#gmail.com', 'blabla');
$list = array('mymail#gmail.com');
$ci->email->to($list);
$this->email->reply_to('mygmail#gmail.com', 'Explendid Videos');
$ci->email->subject($Encabezado);
$ci->email->message($Nota);
$ci->email->send();
}
waht is the problem? please help?
thanks.
Gmail SMTP port is just smtp.gmail.com
So, change this:
$config['smtp_host'] = "ssl://smtp.gmail.com";
To this:
$config['smtp_host'] = "smtp.gmail.com";
Try also to change in config EC2 security group SMTP port from 25 to 465, that is GMail default's port.
Related
I have been trying and failing to get my email configuration working with godaddy. I am using the codeigniter framework (version 3). I even contacted their support but nothing they gave me or i tried worked.
$config['email_address'] = 'no-reply#domain.com';
$config['owner'] = 'name';
$config['email_owner'] = 'no-reply#domain.com';
$config['charset'] = 'utf-8';
$config['mailtype'] = 'html';
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'domain.com';
$config['smtp_crypto'] = 'ssl';
$config['smtp_port'] = '465'; // 465, 25
$config['smtp_timeout'] = '7';
$config['smtp_user'] = 'no-reply#domain.com';
$config['smtp_pass'] = 'xxxxx';
$config['validation'] = TRUE;
I tried the smtpout.europe.secureserver.net that they provide on the website (not working)
This is the last info i got from their support team. Maybe someone sees something i did wrong.
Secure SSL /TLS Settings (Recommended)
Username: no-reply#vbuw.app
Password: email account’s password.
Incoming Server: vbuw.app
IMAP Port: 993
POP3 Port: 995
Outgoing Server: vbuw.app
SMTP Port: 465 IMAP, POP3, and SMTP require authentication.
After calling again to godaddy and getting a diffrent tech support person on the line. We managed to solve the issue.
THIS IS A NONE SECURE (NOT USING SSL) SOLUTION
the smtp_host = mail.domain.app
the smtp_port = 587
the smtp_crypto should be removed (so no ssl)
So for reference
$config['email_address'] = 'no-reply#domain.com';
$config['owner'] = 'name';
$config['email_owner'] = 'no-reply#domain.com';
$config['charset'] = 'utf-8';
$config['mailtype'] = 'html';
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'domain.com';
// $config['smtp_crypto'] = 'ssl';
$config['smtp_port'] = '587'; // 465, 25, 587
$config['smtp_timeout'] = '7';
$config['smtp_user'] = 'no-reply#domain.com';
$config['smtp_pass'] = 'xxxxx';
$config['validation'] = TRUE;
I want to send email using Amazon SES in Codeigniter, i have tried everything, i also tried the earlier questions asked on codeigniter too, but i am not able to find the solution for this.
public function add_applicants()
{
$this->load->model('visa/India_model');
$datan = $this->India_model->insertappdata();
$appid = $datan[appid];
$this->load->library('email');
$config['protocol'] = 'smtp';
$config['charset'] = 'ISO-8859-1';
$config['mailtype'] = 'html';
$config['smtp_host'] = "ssl://email-smtp.eu-west-1.amazonaws.com";
$config['smtp_user'] = "SMTP USER SES";
$config['smtp_pass'] = "SMTP Password SES";
$config['smtp_port'] = "465";
$config['newline'] = "\r\n";
$config['mailsender'] = "support#indiaevisaservice.com";
$config['smtp_crypto'] = 'tls';
$this->email->initialize($config);
$this->email->print_debugger();
$this->email->from('support#verfiedemail.com', 'GYEV Experts');
$this->email->to('imthegrv#gmail.com', 'Test To');
$this->email->subject('Test');
$this->email->message('test');
if($this->email->send()):
print_r($appid);
else:
print_r($this->email->print_debugger());
endif;
}
i am getting error
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
You didn't follow the link provided in the error message, which provides tests that you can use to diagnose your problem.
These three lines are inconsistent:
$config['smtp_host'] = "ssl://email-smtp.eu-west-1.amazonaws.com";
$config['smtp_port'] = "465";
$config['smtp_crypto'] = 'tls';
tls mode will not work on port 465. That should be ssl. Alternatively, change port to 587, and it should be an integer, not a string. There's also no need for the ssl:// prefix on your host; that just adds confusion. First step, change them to this:
$config['smtp_host'] = 'email-smtp.eu-west-1.amazonaws.com';
$config['smtp_port'] = 465;
$config['smtp_crypto'] = 'ssl';
You may still have other issues (e.g. your ISP may block outbound SMTP connections), but there are many other tests listed in the guide that will help you diagnose that.
I have tried the code below and keep getting this error
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'mail.keytimeng.com'; //change this
$config['smtp_port'] = '25';
$config['smtp_user'] = 'info#keytimeng.com'; //change this
$config['smtp_pass'] = 'xxxx'; //change this
$config['mailtype'] = 'html';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config['newline'] = "\r\n";
$this->email->initialize($config);
$config['protocol'] = "smtp";
$config['smtp_host'] = "ssl://smtp.tch-pnt.in"; //
$config['smtp_port'] = 587;
$config['smtp_user'] = "bnft#tch-pnt.in";
$config['smtp_pass'] = "********";
$config['charset'] = "utf-8";
$config['mailtype'] = "html";
$config['newline'] = "\r\n";
$config['wordwrap'] = TRUE;
Error...
I am using above configuration setup for sending email...
No error but i am not getting mails in my inbox.I tried 3 times.
I used default port as 25 still no mails
I think you should try
$config['smtp_host'] = "sslv2://smtp.tch-pnt.in";
or try port number 465.
I am trying to send emails with CI running on MAMP free. But it doesn't work, my script is encountering an infinite loop and nothing is happening...
Do i need to set up something especially to send emails from localhost?
Here is my email config for CI:
$config = array();
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
$config['smtp_port'] = 465;
$config['smtp_user'] = '*****#gmail.com';
$config['smtp_pass'] = '******';
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$config['newline'] = '\r\n';
Cheers
EDIT: Here is my code to send an email:
$config = array();
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
$config['smtp_port'] = 465;
$config['smtp_user'] = '****';
$config['smtp_pass'] = '*****';
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$config['newline'] = '\r\n';
$this->email->initialize($config);
$this->email->from('****');
$this->email->to($email);
$this->email->subject($title);
$this->email->message($content);
$this->email->send();
error_log($this->email->print_debugger());
With $title, $content and $email vars defined in another part of my script. Don't worry about this stuff, I've already checked that my issue is not due to these.
Finally I found the solution:
Send emails with MAMP (mail() PHP function)
Set up SSL: http://soundsplausible.com/2012/01/14/enable-ssl-in-mamp-2-0-5/
Set up Postfix: http://benjaminrojas.net/configuring-postfix-to-send-mail-from-mac-os-x-mountain-lion/
Into MAMP's php.ini (glance phpinfo() to know which version is used and conclude into which folder you need to edit), comment lines SMTP, smtp_port and sendmail_from. Uncomment line sendmail_path and set /usr/sbin/sendmail -t -i as new value.
You should be able to send emails now, if PostFix works fine (run test given in tutorial above).
Send emails with CI
To send emails with CI, you don't need to write your logins into a file for PostFix. However, you need to be able to run PostFix and SSL.
Here is an example of config file for a google account:
$config['protocol'] = "smtp";
$config['smtp_host'] = "smtp.gmail.com";
$config['smtp_port'] = "587";
$config['smtp_user'] = "*****";
$config['smtp_pass'] = "*****";
$config['smtp_crypto'] = "tls"; //very important line, don't remove it
$config['smtp_timeout'] = "5"; //google hint
$config['mailtype'] = "text";
$config['charset'] = "utf-8";
$config['newline'] = "\r\n";
Be careful with " " which are necessary, ' ' could create issues. Here I'm using a TLS connection. If you prefer SSL, use port 465 and fix correctly smtp_crypto value.
You need use sendmail(details how install it on MAMP). Or you can use solution below to store emails in localhost(something like emulate email sending).
I'm use this solution on my localhost(XAMPP). Maybe it will be helpful for you.
Specify path for send mail in php.ini
sendmail_path = "path/to/php path/to/sendmail.php"
The second step - you can try to use this script
define('DIR','path/to/sendmail_dir');
$stream = '';
$fp = fopen('php://stdin','r');
while($t = fread($fp,2048)){
if($t === chr(0)){
break;
}
$stream .= $t;
}
fclose($fp);
$fp = fopen(mkname(),'w');
fwrite($fp,$stream);
fclose($fp);
function mkname($i=0){
$fn = DIR.date('Y-m-d_H-i-s_').$i.'.eml';
if (file_exists($fn)){
return mkname(++$i);
}
else{
return $fn;
}
}