Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I send e-mail using Gmail's SMTP and Indy 10?

I'm using Delphi 2009 and the lastest Indy 10 from svn to send e-mails using SMTP, but it doesn't work with Gmail (Google Apps hosted domain). When I try to send an e-mail I get "Must issue a STARTTLS command first".

I tried Googling about it and I found several forums and several solutions, but they all just bashed some code or just said I needed an OpenSLL DLL, which so far isn't very clear to me exactly what I need.

Can someone please tell exactly which DLL I need and what do I have to change in the my TIdSMTP and TIdMessage objects in order to send the e-mails through Gmail's SMTP server?

Also, an explanation about why this authentication is different and what the DLL is for is very welcome.

like image 214
Fabio Gomes Avatar asked Oct 19 '09 16:10

Fabio Gomes


People also ask

How do I use Gmail SMTP server to send emails?

Set up the app or device with the Gmail SMTP serverOn your device or in the app, enter smtp.gmail.com as the server address. In the Port field, enter one of the following numbers: If you're using SSL, enter 465. If you're using TLS, enter 587.

Can I use any SMTP server to send emails?

The SMTP server for Gmail is a free SMTP server that anyone across the globe can use. It allows you to manage email transactions from your Gmail account via email clients or web applications. Email clients are user-end mail applications. Some of the most popular ones are Thunderbird, Outlook, and Mac Mail.


1 Answers

Perhaps Marco can help you...

Edit: with this link to the source code.

like image 131
Hugues Van Landeghem Avatar answered Nov 15 '22 03:11

Hugues Van Landeghem