Joomla can't send SMTP email on GCE - joomla

I have a weird problem.
I have install Centos7 on GCE.
I know that Google blocked port 25, 465, 587 for SMTP. To make thing simple, I've decided to use Mailgun for MTA.
Mailgun is superbly easy. Everything works fine on localhost. I can send email from Joomla instance.
However, when i I moved to GCE, Joomla (3.5.1) not able to send email. It keeps telling me SMTP connect() failed.
I also tried using another SMTP agent like Gmail, GApps etc. It works on localhost but not GCE.
Is there setting that i missed?

Related

XAMPP SMTP Blocked by Firewall or wrong settings

(PS using xampp)
Apparently my machine won't send out emails using the Mailing APIs(PHPmailer,Swift) and even PHP's own mail() function. But whenever I run my emailing script on another machine, it works with no errors.
Tried it on other machines such as my univ's pcs, friend's pc and my other laptop.
Fatal error: Uncaught Swift_TransportException: Connection could not be
established with host smtp.gmail.com
Tried everything,but still to no avail on my current machine.
What this tells you is that there is nothing wrong with your script, but that your hosting provider blocks outbound SMTP. This is a very common problem, and it's covered extensively in the PHPMailer troubleshooting guide.
How you actually fix it depends on your ISP - it may be that you just need to ask them to unblock it (Scaleway), or that you need to send via their servers (GoDaddy), or in the worst case, that you need to find a new hosting provider...

Laravel mail localhost it's working fine on godaddy server it giving Connection could not be established with host smtp.gmail.com error

I am trying to make a contact form using laravel mail. It works fine on localhost but, when I host it on godaddy share hosting I returns me an error: Swift_TransportException Connection could not be established with host smtp.gmail.com [Connection refused #111],am tried all the methods which are available in stackoverflow but their is no luck.
You have to configure your google account to accept connexions from your host :
In your Google Email Account > Google Account .
On My Account Page click on Security and scroll down to the bottom you will find Less secure app access settings .
Click on the radio button to set it ON.
Though you tagged this question with PHPMailer, you’re not using it. The problem you have is very well known - GoDaddy blocks outbound SMTP. There is nothing you can do to your script or server to make it talk to gmail. I recommend switching to a proper hosting provider that does not block essential services.

Mailgun emails work on local but not server

I am using the same setup as on the server. I have an EC2 instance running Ubuntu, then I am using Docker to host an Ubuntu image with runs my Laravel project on nginx and php7. My local is setup up the exact same, I use the same Docker image and everything.
When I test my emails on my local they work seamlessly, no errors or problems but as soon as I test it on my EC2 I get the following error in Laravel:
Swift_TransportException: Connection to tcp://smtp.mailgun.org:587 Timed Out in /app/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:404
I have tried using ports 25, 2525 and 465 butt he exact same result. Here are my env variables:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_USERNAME=postmaster#placeholder.com
MAIL_PASSWORD=5uup3rL0nGPa55w0RdY0uPr0bablykn0
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=no-reply#placeholder.com
MAIL_FROM_NAME="placeholder Team"
MAILGUN_DOMAIN=placeholder.com
MAILGUN_SECRET=key-MyK3y1s0ac001y0uw15hy0uhadi7h3h3
The secret and password is fake data
On Mailgun's dashboard I have verified my domain (locally I use localhost.MYDOMAIN.com pointing to 127.0.0.1) and all checks are green except for mxa.mailgun.org and mxb.mailgun.org because we are using gmail for our emails. Not sure if this is the source but I cannot risk disabling the emails just for a test.
If I telnet to Mailgun using telnet smtp.mailgun.org 25 (or any other port) I get a connection, so I do get access.
I also applied to relieve the email sending throttling on my server that Amazon puts onto EC2 servers. Not sure when this will actually be in effect so not sure if it will help or not (It might)
I am not sure why I only get a timeout on my server and it works on my local but any advice would be appreciated!
I did try searching around for answers but did not succeed.
WORKAROUND If anyone is struggling with this same issue, it is not worth the effort, rather just implement the Mailgun API, this way you do not have to put up with these issues, it is what I have now done which, had I known about the issues I would have faced, would have done from the start. So still no solution from my side, just avoided it and also why I am not updating with an answer and instead just updating with an edit. Not sure if this is the correct way.

Can we use roundcube, thunderbird or any webmail in our xampp/wamp server?

I have a web application developed in PHP and all users can access it via local network(xampp), now the users want to access their gmail,yahoo or any emails via localhost(xampp), I want something like MS-outlook to work in my xampp.
is there any solution ?
the propper way to do this is if you use email server at localhost better already install apache2 in your own device
also using postfix and dovecot will be very helpfull here some link
about webmail configuration in google cloud instance
https://medium.com/geekculture/how-to-host-a-personal-email-server-on-google-cloud-for-free-part-i-8124d65d1d25
perhaps that concept will help you to develop your own webmail in Local Area Network

amazon-ec2 -> php mail()?

I am running a PHP website on an amazon EC2 Ubuntu server.
I would like to use PHP's mail() function for sending a few admin notification emails per day.
First the mail() function didn't work.
Then I did:
sudo apt-get install postfix
Now it works but I wonder if this is safe? Can my server be used for spam now?
Edit:
No I don't wan't to send spam. :) I don't really know what postfix/sendmail does on the server. My fear was that it installs some open SMTP service which is open to spammers if I don't secure it somehow but I guess this isn't true?

Resources