title: How to send a e-mail for more than one recipient at once, using Delphi and Synapse?
body: <p>Please, I am trying to solve this "problem" for more than 12 hours now... and almost getting crazy! I think is impossible send the same e-mail for more than a recipient (destination) at once, using Delphi and Synapse (<a href="http://synapse.ararat.cz" rel="nofollow">http://synapse.ararat.cz</a>). Please, someone tell me I am wrong :)</p>
  
  <p>Well, I have a sEmail variable, where I get the e-mails separated by point semicolon (;), just like this:</p>
  
  <pre><code>sEmails := 'email1@test.com.br;email2@teste.com.br';
  </code></pre>
  
  <p>Here is the code I am using:</p>
  
  <pre><code>dSMTP := TSMTPSend.Create;
  dSMsg := TMimeMess.Create;
  Try 
    With dSMsg, Header Do
    Begin 
      Date := Now;
      Priority := mp_Normal;
      CharsetCode := ISO_8859_1;
      From := 'email@gmail.com';
      ToList.Delimiter := ';';
      ToList.DelimitedText := sEmails;
      Subject := 'Message Subject';
      dPart := AddPartMultipart('mixed', nil);
      AddPartHTML('&lt;h1&gt;Message Text&lt;/h1&gt;', dPart);
      EncodeMessage;
    end;
    With dSMTP Do
    Begin
      TargetHost := 'smtp.gmail.com';
      TargetPort := '587';
      AutoTLS := True;
      UserName := 'email@gmail.com';
      Password := 'password';
      Try
        If Login Then
        Begin
          If MailFrom('email@gmail.com', Length('email@gmail.com')) Then
            If MailTo(sEmails) Then MailData(dSMsg.Lines);
          Logout;
        end;
      Except
        On E: Exception Do ShowMessage(E.Message);
      end;
    end;
  Finally
    dSMsg.Free;
    dSMTP.Free;
  end;
  </code></pre>
  
  <p>I already tried like this:</p>
  
  <pre><code>If Login Then
  Begin
    If MailFrom('email@gmail.com', Length('email@gmail.com')) Then
      If MailTo(dSMsg.Header.ToList[0]) Then MailData(dSMsg.Lines);
    Logout;
  end;
  </code></pre>
  
  <p>... but then only the first e-mail was sent :( Even if add the rest of e-mails in the Header.CCList.</p>
  
  <p>In another test I tried to change point semicolon for comma (,), with same problem...</p>
  
  <p>Please, please, can someone tells what I am doing wrong?</p>
  
  <p>Thank you!</p>