Jak wyglada dzialajacy kod ktory wysyla e-mail logujac sie na poczte gmail? i zeby nie bylo ze nie szukalem to:
PRZYKŁAD 1
Komunikat "Jakis blad!"
if SendToEx('nadawca', 'odbiorca', 'tytul', 'smtp.gmail.com:465', Memo1.Lines, 'moj adres gmail', 'haslo') = True then
begin
ShowMessage('Wysłane OK.');
end
else
begin
ShowMessage('Jakiś błąd!');
end;
end;
PRZYKŁAD 2
Dostaje komunikat "Other undefined Status". Sypie sie na Login, a raz udało mi się zalogować, ale błąd wyskoczył na StartTLS
http://www.synapse.ararat.cz/doku.php/public:howto:smtpsend
PRZYKŁAD 3
A tutaj to wcale bajka. Żadnych komunikatów plik wczytuje, w memo1 mam cały TMimemess ale maila na adres nadawcy nie dostaje za cholere.
var
m:TMimemess;
l:tstringlist;
p: TMimepart;
begin
m:=TMimemess.create;
l:=tstringlist.create;
try
p := m.AddPartMultipart('mixed', nil);
l.loadfromfile('c:\search.txt');
m.AddPartText(l,p);
m.AddPartBinaryFromFile('c:\search.txt',p);
m.header.from:='moj adres e-mail';
m.header.tolist.add('odbiorca');
m.header.subject:='test message';
m.EncodeMessage;
memo1.lines.assign(m.lines);
//if you wish to send it by SMTP too, then:
SendToRaw('moj adres e-mail', 'odbiorca', 'smtp.gmail.com:465', m.lines, 'user', 'password');
finally
m.free;
l.free;
end;
end;
Próbowałem też na porcie 587 jak i AutoTLS: true i FullSSL?