Einzelnen Beitrag anzeigen

Mike_

Registriert seit: 26. Mär 2008
98 Beiträge
 
Delphi 2007 Professional
 
#41

AW: Delphi: E-Mail-Versand / E-Mail-Formatierung

  Alt 6. Feb 2011, 13:15
Step by Step:

Ich denke nicht dass es an der Delphi Version liegt, sondern dass du den Quellcode kopiert hast und ein paar Propertys von mir nicht übernommen hast, welch eich direkt bei den Komponenten auf der Form eingestellt habe (Und diese somit nicht in der .pas stehen).

################################################## ############
# GoogleMail SendIt v.0.1
#
# Little Tutorial how to send Mails through Gmail with Delphi
# Greetings flying out to limebulls.com
################################################## ############

1.) Put the following components on your application:

a -> TButton
b -> TIdSSLIOHandlerSocketOpenSSL
c -> TIdMessage
d -> TIdSMTP

Leave the "standard names". (!)

2.) Set the propertys to the following components of you app. :

IdSMTP1 -> AuthType -> atDefault
IdSMTP1 -> IOHandler -> IdSSLIOHandlerSocketOpenSSL1
IdSMTP1 -> UseTLS -> utUseRequireTLS
IdSSLIOHandlerSocketOpenSSL1 -> (TIdSSLOptions) -> Method -> sslvSSLv3
(v.2 is no longer available @ google mail server)

3.) Finish it !

Doubleclick your Button on the form and paste :

Delphi-Quellcode:
IdSMTP1.Host := 'smtp.googlemail.com';
IdSMTP1.Port := 587;
IdSMTP1.Username := 'USERNAME'; //WITHOUT @gmail.com
IdSMTP1.Password := 'PASSWORD';
IdSMTP1.Connect;

IdMessage1.From.Name := 'Bill';

IdMessage1.From.Address := 'YOURMAIL@googlemail.com';
IdMessage1.ReplyTo.Add.Address := 'YOURMAIL@googlemail.com';
IdMessage1.Recipients.Add.Address := 'YOURMAL@googlemail.com';

IdMessage1.Subject := 'Betreff';
IdMessage1.Body.Text := 'Test';
IdSMTP1.Send(IdMessage1);
IdSMTP1.Disconnect;
You´re done !
Delphi-Nachwuchs

Geändert von Mike_ ( 6. Feb 2011 um 13:36 Uhr)
  Mit Zitat antworten Zitat