[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.

Question
[x]
Attachment Details

smtp authentication and send mails with attachments using delphi

Asked by GEMINI-INDIA in Simple Mail Transfer Protocol (SMTP), Graphics and Delphi Programming

Tags: Delphi

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;
[+][-]10/13/09 06:40 AM, ID: 25559741Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/13/09 09:42 PM, ID: 25567299Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/14/09 06:48 AM, ID: 25570399Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/15/09 12:30 AM, ID: 25578090Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/15/09 06:25 AM, ID: 25580248Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/16/09 05:22 AM, ID: 25588788Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/16/09 06:45 AM, ID: 25589427Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/16/09 06:46 AM, ID: 25589438Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/18/09 09:08 PM, ID: 25602584Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/19/09 06:15 AM, ID: 25604839Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/19/09 09:13 PM, ID: 25611024Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/24/09 01:11 AM, ID: 25651261Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091021-EE-VQP-81 - Hierarchy / EE_QW_3_20080625