|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by GEMINI-INDIA in Simple Mail Transfer Protocol (SMTP), Graphics and Delphi Programming
I am not able to send mails using smtp by authenticating with user name password. The code is given below. But when i try SendCmd without attachements it is working. I need to send mails with attachements. Could any one help, how to send mails using SMTP authentication and send mails with attachments.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
|
SMTP1.Host := HostName;
SMTP1.Port := 25;
SMTP1.AuthenticationType := atLogin;
SMTP1.HeloName := 'domain.com';
SMTP1.Username := FUserName;
SMTP1.Password := FUserPwd;
//-------------------------------------------------------------
MailMessage.From.Address := From_Name;
MailMessage.From.Name := From_Name;
MailMessage.Recipients.EMailAddresses := To_Address;
MailMessage.CCList.EMailAddresses := CC_Address;
MailMessage.BccList.EMailAddresses := BCC_Address;;
MailMessage.ReplyTo.EMailAddresses := Reply_To;
MailMessage.Body.Text := memo1.Lines.Text;
MailMessage.Subject := Subject_Name;
for iCnt := 0 to pnlAttach.ControlCount - 1 do
begin
strFileFullPath := st_lstAttachments.Values[st_lstAttachments.Names[iCnt]];
if FileExists(strFileFullPath) then
TIdAttachment.Create(MailMessage.MessageParts, strFileFullPath);
end;
//-------------------------------------------------------------
try
SMTP1.Connect;
SMTP1.Send(MailMessage);
finally
SMTP1.Disconnect;
end;
|
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625