I have a simple website which runs with Joomla!, and it has a contact form from where the visitor can send a message to me. This message is sent by e-mail using the sendmail service.
The website machine is running inside Google Compute Engine, and by default I can't send e-mails from it (that's a restriction imposed by Google). To achieve the goal of sending e-mails, a 3rd-party service is needed, such as SendGrid.
I created a free account on SendGrid using the Google Cloud partner program, validated my user and so on. The account is properly provisioned.
I configured my sendmail service to use SendGrid to deliver the e-mails, according to this tutorial. Everything seems to be ok, but... no message is delivered at all.
My mail log at /var/log/mail.log shows:
Jan 21 16:22:10 web-hosting sm-mta[16350]: t0JHWaec027559: to=<[email protected]>, delay=1+22:49:34, xdelay=00:00:00, mailer=relay, pri=23251559, re
lay=smtp.sendgrid.net., dsn=4.0.0, stat=Deferred: Connection timed out with smtp.sendgrid.net.
According to Google, my machine can't use the ports 25, 465 and 587, so I changed the configuration to use the port 2525 in the sendmail.mc file. Nothing changed.
Any hints? My machine is running Ubuntu 14.04LTS.
$ curl -d '[email protected]&toname=Destination&subject=Example Subject&text=testingtextbody&[email protected]&api_user=your_sendgrid_username&api_key=your_sendgrid_password' https://api.sendgrid.com/api/mail.send.json- heitortsergent