Please I need help with the SMTP HOWTO especially with the format of the
sFileName file
// e-mail template (subject and other headers+CRLF+CRLF+e-mail body)
// in file sFileName
As I understand
- sFileName is loaded into the StringList
- From and To are inserted into the first two positions of the list :
msg_lines.Insert(0, 'From: ' + sFrom); //sFrom is my Yahoo mail adress
[email protected]
msg_lines.Insert(1, 'To: ' + sTo); //sTo is my GMX e-mail
adress [email protected]
- Then, how many CRLF do I have to add? And where do I place the Subject
line?
My sFile looks like this: (of course <CRLF> is only here for explanation
Subject: DAS MESSAGE <CRLF>
<CRLF>
<CRLF>
<CRLF>
<CRLF>
the quick brown fox <CRLF>
jumps over the lazy dog <CRLF>
My sample code is modified like this to simplify the whole thing:
if not smtp.Login() then writeln('SMTP LOGIN ERROR');
if not smtp.StartTLS() then writeln('STARTTLS ERROR');
if not smtp.MailFrom(sFrom, Length(sFrom)) then writeln('FROM ERROR');
if not smtp.MailTo(sTo) then writeln('TO ERROR');
if not smtp.MailData(msg_lines) then writeln('MAIL DATA ERROR');
if not smtp.Logout() then writeln('LOGOUT ERROR');
What I get on the console is:
- FROM ERROR
- TO ERROR
- MAIL DATA ERROR
I am trying Port 25 and 587: in both cases I get the 3 errors above
Mit freundlichem Gruß / Yours sincerely / Cordialement
Christian Sporer
logo_ohne_untertitel_1
Grüntenstr.18
80686 München
Tel.: +(49) 89 54217952
Fax.: +(49) 89 52389119
_______________________________________________
synalist-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synalist-public