how to send an email address with delphi 2010, for example (verefication email, password loss or any html / plain text emails).
I tried to use the following code, but when I try to send mail, I get EIdSocket Eroor with message 'Socket Error #10060 Connection Timed Out' .
procedure TForm5.btnSendMailClick(Sender: TObject); begin //setup SMTP smtppass := ed_IdVerification.Text; SMTP.Host := 'smtp.google.com'; // Controle a distance SMTP.Port := 465; smtp.Username := ' hetallica69@gmail.com '; smtp.Password := QuotedStr(smtppass); //setup mail message MailMessage.From.Address := ' hetallica69@gmail.com '; MailMessage.Recipients.EMailAddresses := ' _rafik@live.fr '; MailMessage.Subject := 'Confirm your account'; MailMessage.Body.Text := 'Text goes here'; //send mail try try if not smtp.Connected then SMTP.Connect() ; SMTP.Send(MailMessage) ; except on E:Exception do ShowMessage(E.Message); end; finally if SMTP.Connected then SMTP.Disconnect; end; end;
source share