SMTP 535 5.7.0 Error: authentication failed - codeigniter

I used SMTP protocol for sending email in my system.The system is developed with Codeigniter.in the system two types of email sending functionality, one is from codeigniter Email libraries and other is from swift mailer.In codeigniter it is working but in swift mailer an authentication failure message is shown.
Both functions use same login details.The port used is 25.

Give a try with this gmail smtp
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl')
->setUsername('YOUR_GMAIL_ID')
->setPassword('YOUR_GMAIL_PASSWORD') ;
If it works with this than I think your hosting provider not giving smtp service to you so, you need to contact your hosting provider.

Related

send email in laravel by gmail smtp server

I want to use Gmail to send emails through Laravel.
When I apply through localhost, the email is sent correctly.
But it gives the following error on the server and the email is not sent.
local.ERROR: Swift_TransportException: Connection could not be established with host smtp.gmail.com $:stream_socket_client(): unable to connect to tcp://smtp.gmail.com:587 (Connection timed out)
Hello I had the same problem probably your solution is like that, because this helps me to resolved my issue
Create a custom app in you Gmail security settings.
Log-in into Gmail with your account
Navigate to https://security.google.com/settings/security/apppasswords
In 'select app' choose 'custom', give it an arbitrary name and press generate
It will give you 16 chars token.`
Use the token as password in combination with your full Gmail account and two factor authentication will not be required.
Note: The link in step 2 will work only if you have 2-factor-authentication enabled.
For Refference: link
use mail trap for testing
link https://mailtrap.io/ where you get your all smtp credential and put in .env file

Sending Email using Outlook / Office365 with Laravel - Failed to authenticate on SMTP server

I'm trying to send an email with our Laravel app using Office365/Outlook. It has worked well with gmail but when I switched over to Office365, the following error appears:
Failed to authenticate on SMTP server with username
"xxxxxx#companyname.co" using 2 possible authenticators. Authenticator
LOGIN returned Expected response code 235 but got code "535", with
message "535 5.7.3 Authentication unsuccessful
[HKAPR03CA0035.apcprd03.prod.outlook.com]
". Authenticator XOAUTH2 returned Expected response code 235 but got code "535", with message "535 5.7.3 Authentication unsuccessful
[HKAPR03CA0035.apcprd03.prod.outlook.com]
".
This is what I have in my .env file:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.office365.com
MAIL_PORT=587
MAIL_USERNAME=xxxxxx#companyname.co
MAIL_PASSWORD=emailPassword
MAIL_ENCRYPTION=tls
MAIL_SMTPAuth=true
MAIL_FROM_NAME=CompanyName
MAIL_FROM_ADDRESS=xxxxxx#companyname.co
*note: this is not the real username, password and from address.
I also tried changing the port to 25 but I get the same error
I'm using a dedicated support email from my company. And from what I confirmed with our IT, the support email does not have 2 factor authentication and the "Authenticated SMTP" setting is also enabled via the admin panel of Office365 so I don't know what seems to be the problem.
Keep in mind that for the new tenants, Microsoft turns SMTP authentication off, and it needs to be explicitly enabled. Please see
Enable or disable authenticated client SMTP submission (SMTP AUTH) in Exchange Online
as well as
What are security defaults?
I had the same issue and I called Microsoft support. They instructed me to change some security properties in Microsoft Azure. Here is my answer.
You have to enable the 2 factor authentication, the go to your account settings and create an application password. Then you have to use the new application password in your code. Check this link

Send mail with Laravel Lumen

I've a domain and an email address dedicated. I've a SMTP server provided by my domain. I'm asking myself if it's possible to send mail directly with this SMTP server without passing through API like MailGun (because, it's not free!), and how can I do that ?
Thanks !

Email Function - Webforms drupal 7

Here I have two queries:
SMTP authentication in MS Outlook mail
Used modules are SMTP authentication and webforms for drupal 7
Initially I used the gmail domain for SMTP authentication mails triggered to my recipients. Here my requirement is Microsoft outlook domain for SMTP authentication. My recipients are unable to receive mail. Please guide me.
SMTP AUTHENTICATION
Here I used the steps:
Turn this module on or off --> on
Turn on delivery of emails --> on
SMTP SERVER SETTINGS:
SMTP server --> smtp.office365.com
SMTP Port --> 587
encrypted protocol --> TLS
SMTP AUTHENTICATION (used microsoft outlook mail)
Username: ---> retail#companyname.com
Password: ----> xxxxxxxxxxx
How can I add CC and BCC in mail by using webforms in drupal 7?
You can send emails to multiple addresses, the email can be send to each address separately (if you don't want all recipients to see each other) or you can send one email to multiple addresses. Configuration is located on your webform: node/yourNID/webform/emails
However if you really wish CC there's a module for that: https://www.drupal.org/project/webform_cc
Or you can create your own function:
mytheme_webform_mail_headers($variables) {
$headers = array(
'X-Mailer' => 'Drupal Webform (PHP/' . phpversion() . ')',
);
$headers['cc'] = 'email#example.com';
return $headers;
}

my issue by sending email with smtp server in joomla1.5?

background
I have a Joomla 1.5 site, for registering user in site to enable the email sending system's, configured the smtp server in joomla configuration.
my config is:
mailer:'smtp server'
smtp host:'smtp.gmail.com'
smtp user:'myuser#gmail.com'
smtp psw:'mypass'
smtp port:'465'
smtp authentication:'yes'
smtp security:'ssl'
I don't know becuase does not Work and it is worth noting that php mail function dosen't work!
This is Answer Of Question:
I'm use the free-hosting and the hosting company block the many php functions.
One of the php functions is fsockopen that socket to smtp server to connect them.
I hope this experiment help my friends.
uncomment "extension=php_openssl.dll" in your php.ini file
add exception for port 465
extension=php_openssl.dll
is used for windows hosting only, and most probably you will be using linux hosting so you don't need to worry about it.
I had a similar issue like yours and it turned out that the php function that I wrote in a script was not using smtp set in Joomla configuration, to confirm try using password reset or some other function that uses email from Joomla framework, and if you get that email successfully that would mean that your php email function is not using smtp.

Resources