Bekz.net - (14014 of 825556 - 2%) 

 Home | Tips & Tricks | General Info | Downloads | NG Archive | Links | Email | Search | Register | Users | Login

 


 

Tips & Tricks

 

Rating: 52% (5 votes registred)
Rate this item:

Back to list

I have been trying to send an email using the TSMTP class and it does not work, what can I do?

Four important things to remember:

1) You must call TSMTP from a window.
2) You must have an eMailm address in cFrom.
3) You must initialize a dummy oTSMTP before the real on (due to a bug)
4) You must pass the IP adress, not the name (you can find the address from the name using getHostByName() )

// due to bug, you must init a dummy first
oDummy:=TSmtp():New(getHostByName(cIPServer))

// this is the real one
oOutMail:=TSmtp:New(getHostByName(cFrom,   ; // From
                                  aTo,     ; // To (Array)
                                  cMsg,    ; // Message text
                                  cSubject,; // Subject
                                  aFiles )   // Attached files (Array)

 

 

 

 

© 2002 Bekz.net, Inc. All Rights Reserved.