New Blog Post: RESTful Reporting

Group Email error - Must issue a STARTTLS command first

Hi,

I am able to successfully send email for Gmail with the ppSMTPIndy email plugin using the SendMail method, however when I trying to send individual emails using Email Group, I receive a "Must issue a STARTTLS command first" error.

I am using the EmailGroupDemo example and have added the Gmail email configuration code from the IndyGmail example. I receive the "Must issue a STARTTLS command first" error twice when running the EmailGroupDemo application, which I thought was a bit strange since the demo is attempting to send three emails.

I am using the latest version of ReportBuilder 19 and Delphi XE2. I can recreate the same issue in Delphi 10 Tokyo.
Thanks,
Scott

Comments

  • Hi Scott,

    Group email does not use the TppEmail object to send. A separate SMTP plugin is used by the file device to send each group individually as it is generated to file. You will need to set up this plugin similarly to the way you did with the Report.Email.SMTP plugin before.

    When emailing groups, the SMTP object is assigned to the FileDevice before generation. This property is public so you can make customizations beyond what the EmailSettings allow.
    procedure TForm1.ppReport1FileDeviceCreate(Sender: TObject); 
    begin 
      TppSMTPIndy(ppReport1.FileDevice.SMTP).Port := 587;
      TppSMTPIndy(ppReport1.FileDevice.SMTP).UseTLS := True;
    end;
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • Ah, worked great!! Thanks again for your assistance, I appreciate it.
    Thanks,
    Scott
  • My question may be related so I'm posting it here.
    We just switched to gmail and are send payment notifications to vendors ( approx. 50 at time ).
    First, I don't know if I have the most recent demo files but can't seem to find anything relating to Emails. Could I be missing something ? Running version 19.0 on D10.2, Indy 10
  • Hi Ron,

    The included email demo is part of the main reports demo (Demo #110). This demo does not however give an example of sending individual groups as emails. See the following article on how this can be done.

    Note my response above on how to set up group emails with Gmail.

    http://rbwiki.digital-metaphors.com/output/email/how-to-email-groups/


    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
Sign In or Register to comment.