I am using Laravel 5.1
I made a contact page in my application. So users can send an email. Here I have used mailtrap.io
It works when I have created. I mean there was no problem to send mail to mailtrap.io
But today, when I was checking this again, It shows me this error.
Swift_TransportException in StreamBuffer.php line 268:
Connection could not be established with host mailtrap.io [A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. #10060]
I have checked my .env file with mailtrap.io setting. everything is ok. Here is my .env file setting
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=25
MAIL_USERNAME=[username]
MAIL_PASSWORD=[password]
MAIL_ENCRYPTION=tls
Anyone please help me?
Probably you have issues with port 25 being blocked by your provider or host.
You can verify this using telnet:
telnet smtp.mailtrap.io 25
If you get no response or a timeout, you can not use port 25.
Mailtrap allows you to use 2 other ports, 2525 and 465.
You can verify with telnet if those ports are working.
telnet smtp.mailtrap.io 2525
If that connects properly, modify your .env file to use 2525.
If you are using php artisan serve instead of homestead or something else, be sure to restart after making changes to your .env.
try
MAIL_PORT=465
instead of
MAIL_PORT=2525
like this
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=465
MAIL_USERNAME=your_username
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=tls
Update your composer by giving
composer update
and run your application.
Related
My play framework web application sends automatically emails to user using Apache commons email library, everything works fine on my machine, but when I deploy it on an Ubuntu server it is unable to send email.
It throws exceptions like org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.googlemail.com:465 (I also tried different configuration with smtp.google.mail port 465,25 and 587 with or without ssl and tls)
and connection timed out.
I starting to believe that is a problem of some configuration of my ubuntu server.
Any suggestion?
If i type ufw status command I receive status disabled.
Thanks
I am going to close this question, because I found the solution. Basically my Server provider (Scaleway) has a security configuration where SMTP is blocked. I asked them to unlock It.
I've got dedicated server to run all my sites from.
I created domain and updated all DNS records to this server, everything is fine and propagated however when i try and receive mail nothing happens but it can send.
I went to dnsstuff.com and this is the error i got...
All connections to Mailservers port 25 have failed. The standard port
for SMTP transactions is 25, so your servers should be operating on
that port. It is recommended that it be fixed in order for your mail
service to operate properly. The Mail Servers that failed are:
xx.xxx.xxx.xxx | failed message send with: failed cx open with: failed socket connect with: Operation now in progress
/*****************
UPDATE
*****************/
Running a linux box using centOS.
The mailserver being used is, I believe, Postfix.
How do i fix this problem?
Check your firewall configuration on your server. If you can send from localhost (that is, direclty from your server), but mail can't be delivered from remote servers to your box, your firewall is the best bet to look at. Basically port 25 should be open to any IP. It's hard to give you specific details on how to configure your firewall, as you do not specify your OS and dikstribution. Most Linux distro's run some flavour of iptables. If iptables is what you have, you could try this command from the command line:
iptables -A INPUT -p tcp --dport 25 -j ACCEPT
Before you open up your firewall, you might want to dive into configuring postfix. It would not be nice to the rest of the world if you started running an open relay. That will get your server blacklisted in no time. This artice on the postfix website will give you a decent start.
I've got Jenkins ver 1.524 installed on a Windows 7 box and I'm trying to configure email but the "Test configuration" is reporting errors. Jenkins is running as a service under my own domain account.
My settings are as follows:
SMTP server: smtp.corpdomain.com
Default user email suffix: #corpdomain.com
Not using authentication
Not using SSL
SMTP port: 25
Reply-To Address: tools#corpdomain.com
Charset: UTF-8
When I test the configuration, I usually get the following exception:
javax.mail.MessagingException: Could not connect to SMTP host: smtp.amazon.com, port: 25;
nested exception is:
java.net.ConnectException: Connection timed out: connect
Yet every once in a while I receive the following instead:
com.sun.mail.smtp.SMTPSendFailedException: 553 5.1.8 <nobody#nowhere>... Domain of sender address nobody#nowhere does not exist
;
nested exception is:
com.sun.mail.smtp.SMTPSenderFailedException: 553 5.1.8 <nobody#nowhere>... Domain of sender address nobody#nowhere does not exist
However, I am able to send mail from the command line without errors via both python script and java (using javax.mail) without authentication, and I'm able to telnet to the SMTP server on port 25, so I don't see how it could be a firewall issue.
One other note that may be related: When I try to install a plug-in via the Jenkins web interface, I receive a 403 response for the URL "http://updates.jenkins-ci.org/update-center.json?uctest". However, I'm able to connect to that URL from a browser on the same machine.
Could this be a Tomcat configuration issue? I'm not familiar with Tomcat so I'm not sure where to even start looking. Maybe a Jenkins configuration that I've missed? Any other ideas?
Thanks in advance!
FWIW The nobody#nowhere address is the default address Jenkins comes with for the system admin email address (which is used as the from address when sending emails)
you can change it at
Manage Jenkins > Configure System > Jenkins Location
first, use port 465
second, get your email verified in AWS SES, and change your default sending email from here:
Jenkins -> Configure System -> Jenkins Location -> System Admin e-mail address
Still looks to me like your firewall is blocking Jenkins' service from accessing those ports -
especially as the connection times-out, which is typical for such cases.
Suggest you try to disable the firewall completely and see if there is any change.
Cheers
To check for conectivity problems from Jenkins, I would go to the Script Console at Manage Jenkins -> Script Console, and there, try to connect to the port you want to test (25 in your case), with a Groovy script like:
s = new Socket()
s.setSoTimeout(200)
s.connect(new InetSocketAddress("smtp.corpdomain.com", 25), 200)
s.close()
If you don't receive any kind of IOError, then there is no problem with the conectivity.
Note: I could have used simply new Socket("smtp.corpdomain.com", 25) but it will try forever to connect if the Firewall ignores your attempts.
For the SMTPSendFailedException you eventually receive, as #paul-henry mention:
The nobody#nowhere address is the default address Jenkins comes with for the system admin email address (which is used as the from address when sending emails)
you can change it at
Manage Jenkins > Configure System > Jenkins Location
Resources:
Networking with Groovy
Add a timeout when creating a new Socket
Thanks for submitting an edit. It is only visible to you until it’s been approved by trusted community members
first, use port 465 second, get your email verified in AWS SES, and change your default sending email from here: Jenkins -> Configure System -> Jenkins Location -> System Admin e-mail address
Thanks. It helps me!
My problem was "550-Verification failed for "
I want to send APN (Apple Push Notification) from PHP script. My PHP script is working fine and I receive notification in the iphone device as well when sending from localhost but when I upload the same script with same .pem file to the shared server it returns error...
Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.push.apple.com:2195 (Connection refused) in /mypath/SendPushNotification.php on line 28 Failed to connect: 111 Connection refused
From some source I get to know that to send APN port 2195 must be open which is not possible in the shared server plan. So I tried using dedicated server and it's working perfectly and I receive the notification on the device. I tried hard to find the solution for shared server but didn't find any solution.
My question: is it possible send APN without opening port 2195 from shared server? if Yes give some guidance.
No, Its not possible to send APN message without using 2195 port.
If you want to send push notification message from shared server, try using some third party tools like http://urbanairship.com/.
Some time ago I got the same error, and then I found that it ocurres because of the server, the proxy is blocking that port, because most of servers doesn't use that port as a common one(80 or 21).
In this case you could try asking for support on your server reseller , they can open that port (2195) for you, If your take this solution I would recommend also asking to open the port 2196 that port is used for feedback.
Another solution is to use a free push notification provider, like Parse which is really easy to use and implement on your app, also you can use UrbanAirship, but I preffer Parse ;)
Hope it helps
This is irritating and definitely port 2195 issue. Chat with your hosting provider and ask them to open the port. I also had same issue. My Local code was running peacefully in every condition like sandbox and production but it was failing on the server.
Dont get confused about .pem file path and that would be simple corresponding to your code. For me i put my certificates (.pem) in a directory named certs and gave path like this:
$apnsCert = 'certs/cert_prod.pem';
The code was not working on my apps production server. I wasted one and a half day on this but that ran great on first run when i put that on application's staging server. Reason!!!! Definitely port 2195 issue.
All the beat.
I'm using centos 5 and sendmail on intranet server. Local mail is being delivered perfectly, but when i try to deliver email to gmail, for example (or any other service outside intranet) i find following errors in my logs:
Jan 16 16:50:32 testlink sendmail[27713]: r0GCoVi5027711: to=<example#gmail.com>,
ctladdr=<webdev#testlink.ru.corp.domain.com> (502/502), delay=00:00:01,
xdelay=00:00:01, mailer=esmtp, pri=120332, relay=alt4.gmail-smtp-in.l.google.com.
[173.194.68.27], dsn=4.0.0, stat=Deferred:
Connection refused by alt4.gmail-smtp-in.l.google.com.
one more important thing - server is not accessible from internet, but i can access internet from my server..
Please advice where should i search the problem.. i understand that i should setup sendmail somehow (currently i'm using default configuration that was set by yum), but what settings (or at least direction)... Thanks in advance!
run ifconfig in command line. perhaps something is wrong with your IP
also look into iptables -L
netstat -nap should have a string
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 5275/sendmail
check if provider blocks port 25:
telnet smtp.ukr.net 25