I have successfully configured the smtp connection on local but when i am using it on live go-daddy its throwing e error that connection has been refused.
$smtpOptions = new \Zend\Mail\Transport\SmtpOptions();
$smtpOptions->setHost('smtp.gmail.com')
->setConnectionClass('login')
->setName('smtp.gmail.com')
->setConnectionConfig(array(
'username' => 'XXXXXX#gmail.com',
'password' => 'XXXXX!',
'ssl' => 'tls',
))
->setPort('465');
$transport = new \Zend\Mail\Transport\Smtp($smtpOptions);
i have tried port 587 also. Would be great if someone could guide me how to solve this . Stuck over this from few days . thanks
See configuration of your godaddy mail server. I use following host for godaddy account -
mail domain: smtpout.secureserver.net
host: 173.201.193.101
port: 25
Above configuration works fine for me. Please use your own username and password that is not mention here. Also I use SMTP for mail transport.
Related
Throughout my Laravel 5.4 codebase, I am using Amazon SES to send email:
Mail::to('myemail#example.com')->send(new App\Mail\MyEmailClass);
Not a problem. Except I am working in a team, and I test email a lot. I want to use Mailtrap.io for testing emails rather than spamming my own account(s).
To configure Mailtrap with PHP/Laravel, I am required to use the SMTP driver and Mailtrap SMTP host, and port:
return array(
"driver" => "smtp",
"host" => "smtp.mailtrap.io",
"port" => 2525,
);
My driver is currently set to use SES.
How can I use multiple drivers: SES and Mailtrap?
I dont know if you still facing this problem...Instead of you change "mail.php" inside the "config" directory, why not considering insert this in ".env" file entering the following parameters:
MAIL_DRIVER = smtp
MAIL_HOST = smtp.mailtrap.io
MAIL_PORT = 465
MAIL_USERNAME = "get this on mailtrap settings"
MAIL_PASSWORD = "get this on mailtrap settings"
MAIL_ENCRYPTION =
I am using Laravel 4.2, which uses the swiftmailer lib for email. I am trying to use the Sendgrid SMTP service but I am getting an timeout error on my staging server.
Everything works fine in my local development.
mail.php
return array(
'driver' => 'smtp',
'host' => 'smtp.sendgrid.net',
'port' => 587,
'encryption' => 'tls',
'username' => 'username'
'password' => ...
I have switching to port 465 and 'ssl', works on the local but no luck on the server. OpenSSL is enabled on the server.
What is interesting is Mandrill smtp (this uses a different laravel driver) and the local server smtp work fine on the server.
The ports are open. I can telnet into sendgrid from the server. I also switched out the host name for the IPv4 just to checks because of all of the trouble people have with using smtp.gmail.com IPv4 vs IPv6. Didn't make a difference.
The specific error location is this:
$this->_stream = #stream_socket_client($host.':'.$this->_params['port'], $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $streamContext);
if (false === $this->_stream) {
throw new Swift_TransportException(
'Connection could not be established with host '.$this->_params['host'].
' ['.$errstr.' #'.$errno.']');
So my question is what should I check to figure out why swiftmailer and the stream_socket_client php function is working locally but not on the server. Locally I am on a mac, the server is running centOS.
Looks like the application was being run by a user without access to port 587. So if you run into this problem make double sure you are testing the port with the user that is running your application.
I'm not sure if the issue with with Postfix, MediaWiki, LAMP or what. Basically I configured an extension for MediaWiki for AccountRequest and it's supposed to send an email out to the user that created to give them login information. Emails aren't sent out. I figured it might be something to do with settings in localsettings.php but when I add the $wgSMTP array listed below but with my info I start getting [3b2f8024] 2015-11-24 20:19:31: Fatal exception of type "MWException" showing up on mediawiki.
$wgSMTP = array(
'host' => "mail.example.com", // could also be an IP address. Where the SMTP server is located
'IDHost' => "example.com", // Generally this will be the domain name of your website (aka mywiki.org)
'port' => 25, // Port to use when connecting to the SMTP server
'auth' => true, // Should we use SMTP authentication (true or false)
'username' => "my_user_name", // Username to use for SMTP authentication (if being used)
'password' => "my_password" // Password to use for SMTP authentication (if being used)
);
If I leave the localsettings.php settings as enabled and all that it will act like it works but users never get the email.
$wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO
$wgEmergencyContact = "apache#10.00.000.000";
$wgPasswordSender = "apache#10.00.000.000";
$wgEnotifUserTalk = true; # UPO
$wgEnotifWatchlist = false; # UPO
$wgEmailAuthentication = true;
Wondering of a good workaround for this or if someone can point me in the right direction to get this fixed that would be awesome. I've spent hours googling without any results. If my question isn't clear or you need more information please just ask.
Check that the SMTP server is actually reachable. With your $wgSMTP settings, do:
telnet mail.example.com 25
and see if you can connect. If not, either there is no SMTP server running there or there is a firewall. Double check the SMTP host and port, check instructions on how to open firewall in your distribution.
I am trying to write a PHP script for a live production server to check if the IP whitelisting for the open SMTP relay settings on a Google account works properly.
Since the server is currently live I don't want to change any of the /etc/postfix/main.cf settings for the existing email solution, and thought I would try to write an isolated Zend_Mail script that could test it independently, but I'm having difficulties getting Zend_Mail to acknowledge an SMTP connection without login credentials.
I've tried different variations on
$domain = 'foo.bar.com';
$config = array('ssl' => 'tls', 'username' => 'noreply#bar.com');
$transport = new Zend_Mail_Transport_Smtp($domain, $config);
Zend_Mail::setDefaultTransport($transport);
$mail = new Zend_Mail();
$mail->setBodyText('This is the text of the mail.');
$mail->setFrom('noreply#bar.com', 'NoReply');
$mail->addTo('jono#gmail.com', 'jono');
$mail->setSubject('TestSubject');
$mail->send();
but it only times out, and I can't find any config options that would help.
So the question is, is it possible to send mail using Zend_Mail through a Google SMTP relay without using any login credentials, if the IP is whitelisted in the Gmail settings? If not, is there any other way to do this through the command line or another PHP library?
Try to change your $config array like this :
$config = array('ssl' => 'tls', 'port' => 587, 'auth' => 'login', 'username' => 'noreply#bar.com', 'password' => 'password');
$smtpConnection = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config);
Hi I'm trying to send some emails via gmail from the Zend_Mail module.
This is my code:
$config = array(
'ssl' => 'tls',
'port' => 587,
'auth' => 'login',
'username' => 'webmaster#mydomain.com',
'password' => 'password'
);
$smtpConnection = new Zend_Mail_Transport_Smtp('smtp.gmail.com', $config);
Error:
Warning: stream_socket_enable_crypto() [streams.crypto]: this stream does not support SSL/crypto in /library/Zend/Mail/Protocol/Smtp.php on line 206
Unable to connect via TLS
I tried telling my hosting provider to enable the openssl.dll in phi.ini
But they say that isn't necessary since the server is in Linux and it doesn't need to enable the openssl.dll to work with TLS or SSL.
Is my hosting provider wrong or I'm I doing something wrong in my code.
Thanks in advance
Fabian
openssl.dll is the windows openssl extension.
On Linux you need to compile PHP with OpenSSL support.
http://www.php.net/manual/en/openssl.installation.php
You need OpenSSL for PHP sockets and stream functions to use TLS. Zend uses these functions and thus require the same.
I was having a similar problem here is what worked;
Using Zend mail transport and yahoo smtp:
$mailhost= 'smtp.example.com';
$mailconfig = array(
'auth' => 'login',
'username' => 'me#example.com',
'password' => 'topsecret',
'port' => '465',
'ssl' => 'ssl'
);
$transport = new Zend_Mail_Smtp($mailhost, $mailconfig);
Zend_Mail::setDefaultTransport($transport);
This produced an error: "Permission denied" and no mail was sent. After three weeks of trying all solutions I could find the one that worked was changing:
$transport to;
$transport = new Zend_Mail_Transport_Sendmail('-fsupport#website.com',$mailhost, $mailconfig);
works as expected...
It's very comfortably to use Zend_Mail::setDefaultTransport method
Try setting ssl:// as prefix for the hostname and use 465 as port.
after hours of troubleshooting, changing
'ssl' => 'tls'
to
'ssl' => 'ssl'
worked for me. It was working fine in previous server. After moving to new server, tls error statrted.