Failed To Send Auth Login Command. Error 530 5.7.0
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Failed to send AUTH LOGIN command. Error: 530 5.7.0 Must issue a STARTTLS command first up vote 0 down vote favorite I am having the following code ini_set("SMTP","ssl://smtp.gmail.com"); ini_set("smtp_port","587"); $config['protocol'] = 'smtp'; $config['smtp_host'] = 'smtp.gmail.com'; $config['smtp_port'] = '587'; $config['_smtp_auth']=TRUE; $config['smtp_user'] = 'sender@gmail.com'; $config['smtp_pass'] = 'password'; $config['smtp_timeout'] = '60'; $config['charset'] = 'utf-8'; $config['wordwrap'] = TRUE; $config['mailtype'] = "html"; $this->email->initialize($config); $this->email->from('sender@gmail.com', 'Sender'); $this->email->to('receiver@gmail.com'); $this->email->subject('This is my subject'); $this->email->message('This is the content of my message'); if ( ! $this->email->send()) { show_error($this->email->print_debugger()); } else { echo('DONE'); } But when the code executes, I am getting the following error Failed to send AUTH LOGIN command. Error: 530 5.7.0 Must issue a STARTTLS command first. qd9sm8462833pbb.31 I have used $this->load->library('email'); in my controller's constructor. But I am unable to send email from localhost. What can be the solution to send email? What changes do I need to make? php codeigniter smtp gmail starttls share|improve this question edited Jun 5 '13 at 12:39 Fabio 14.8k73154 asked Oct 15 '12 at 5:08 Sahil Jariwala 150216 It
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up php smtp authentication issue up vote 0 down vote favorite This is mail1.php page, when I started to use I receive authentication error. http://stackoverflow.com/questions/12889596/failed-to-send-auth-login-command-error-530-5-7-0-must-issue-a-starttls-comman IsSMTP(); // enable SMTP $mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only $mail->SMTPAuth = true; // authentication enabled $mail->Host = "smtp.gmail.com"; $mail->Port = 465; // 587 $mail->IsHTML(true); $mail->Username = "behzatdeniz82@gmail.com"; $mail->Password = "**********"; //Don't reveal password with others $mail->SetFrom("behzatdeniz82@gmail.com"); $mail->Subject = "Test"; $mail->Body = "hello"; $mail->AddAddress("behzatdeniz99@gmail.com"); if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { http://stackoverflow.com/questions/21515006/php-smtp-authentication-issue echo "Message has been sent"; } ?> I received below error message. I changed port numbers and try again, but no result. Can anyone help me ? SMTP -> ERROR: AUTH not accepted from server: 530 5.7.0 Must issue a STARTTLS command first. 8sm65292722eeq.15 - gsmtp SMTP Error: Could not authenticate. Mailer Error: SMTP Error: Could not authenticate php smtp share|improve this question asked Feb 2 '14 at 19:17 Behzat 396 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote Please try: $mail->Host = "ssl://smtp.gmail.com"; to enable SSL. share|improve this answer answered Feb 2 '14 at 19:30 Marcin Barylski 337214 I did as you said but now received this error. " SMTP -> ERROR: STARTTLS not accepted from server: 454 5.5.1 STARTTLS may not be repeated. d6sm18655050wic.9 - gsmtp Language string failed to load: tls Mailer Error: Language string failed to load: tls " –Behzat Feb 2 '14 at 19:35 Yoy may also add: $mail->SMTPSecure = 'tls'; Do you have a SSL certificate on your server? –Marcin Barylski Feb 2 '14 at 19:44 Yes, I Have ssl cert. It works now: $mail->IsSMTP(); // telling the class to use SMTP $mail->Mailer = "smtp"; $mail->Host = "ssl://smtp.gmail.com"; $mail->Port = 465; $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Username = "myname"; // SMTP use
an SSL connection (configured https://confluence.atlassian.com/jirakb/unable-to-send-email-with-smtp-server-via-ssl-530-5-7-0-must-issue-a-starttls-command-first-due-to-mail-smtp-starttls-enable-property-218269287.html as a JNDI resource), mail won't be sent and the following error message is displayed: com.atlassian.mail.MailException: com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. Cause In the JNDI SMTP resource configuration, mail.smtp.starttls.enable isn't turned on. Resolution Enable failed to TLS option when Configuring JIRA's SMTP Mail Server to Send Notifications JIRA 4.4 and earlier - Click here to expand... Double check if "JNDI Location" is specified in SMTP Server Setup Edit