Jump to content

Plainer

Members
  • Content Count

    27
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. Plainer

    Sending rich text emails?

    I had a look at the sample "OverbyteIcsMailHtml", I did not see a way of sending a StartTTLS command, I am sure I must have overlooked it. Is this possible and where should I look? Thanks
  2. Plainer

    Sending rich text emails?

    Thank you for advise, I will try the demo you mentioned. Will
  3. Plainer

    Sending rich text emails?

    I did not know that, so with that said, let me ask is it possible to send formatted text using the ICS Smpt component with HTML? What component would you recommend?
  4. Hello, using one of the ICS SMPT mail components is it possible to send rich text in the body of the email? If it is possible can someone recommend the correct component to use. Thanks Will
  5. Ok, I see that I will make a change and give it a go. Thanks.
  6. Not to clear on what you meant, however I did make a change by moving the next record call within the case statement. It seemed to make matters worse as it no longer sends out an email but still stops after two records. smtpMailFrom: begin SendNextRecord; SslSmtpClient.RcptTo; end; The solution is simply eluding me, the concept seems simple but proving difficult to do. Can you provide an example on the correct insertion point for the next record call? Thanks
  7. I think you are right, The two emails that do send return the following after sending a email. First email: RequestDone Rq=5 Error=0 Second email: RequestDone Rq=9 Error=0 I put in a 2 second delay between sends (procedure TEMail_Send.SendNextRecord;) but no real progress, It is on the third email that the system hangs up. This is the code I am currently working with. procedure TEMail_Send.BitBtn4Click(Sender: TObject); begin DataBase_Mail.GoTop; // not sure about this if SslSmtpClient.Connected then begin MessageBeep(MB_OK); Display('All-In-One demo start in connected state.'); Display('Please quit or abort the connection first.'); Exit; end; FAllInOneFlag := TRUE; FEhloCount := 0; { Initialize all SMTP component properties from our GUI } SslSmtpClient.Host := wDataBase_Cfg.GetTrimString('CHOST'); SslSmtpClient.Port := wDataBase_Cfg.GetTrimString('CPORTHOST'); SslSmtpClient.SignOn := wDataBase_Cfg.GetTrimString('CSIGNON'); SslSmtpClient.FromName := wDataBase_Cfg.GetTrimString('CFROM');; SslSmtpClient.HdrFrom := wDataBase_Cfg.GetTrimString('CFROM'); SslSmtpClient.HdrTo := DataBase_Mail.GetTrimString('COWN1EMAIL'); SslSmtpClient.HdrCc := DataBase_Mail.GetTrimString('COWN2EMAIL'); SslSmtpClient.HdrSubject := DataBase_EMailText.GetString('CSUBLINE'); SslSmtpClient.EmailFiles := nil; // FileAttachMemo.Lines; SslSmtpClient.AuthType := TSmtpAuthType(wDataBase_Cfg.GetInteger('NAUTHTYPE')); SslSmtpClient.SslType := TSmtpSslType(wDataBase_Cfg.GetInteger('NSSLType')); if SslSmtpClient.SslType <> smtpTlsNone then begin SslContext1.SslPrivKeyFile := ''; //KeyEdit.Text; SslContext1.SslPassPhrase := ''; //PassPhraseEdit.Text; SslContext1.SslCertFile := ''; //CertEdit.Text; SslContext1.SslCAFile := ''; //CAFileEdit.Text; SslContext1.SslCAPath := ''; //CAPathEdit.Text; //SslContext1.SslVerifyPeer := false; //VerifyPeerCheckBox.Checked; SslContext1.SslVerifyPeer := wDataBase_Cfg.GetLogical('LSSLVERPER'); if SslContext1.SslVerifyPeer then begin SslSmtpClient.OnSslVerifyPeer := SslSmtpClientSslVerifyPeer; SslSmtpClient.OnSslHandshakeDone := SslSmtpClientSslHandshakeDone; end else begin SslSmtpClient.OnSslVerifyPeer := nil; SslSmtpClient.OnSslHandshakeDone := nil; end; end; SslSmtpClient.Username := wDataBase_Cfg.GetTrimString('CUSERNAME'); SslSmtpClient.Password := wDataBase_Cfg.GetTrimString('CPASSWORD'); SslSmtpClient.HdrPriority := TSmtpPriority(wDataBase_Cfg.GetInteger('NPriority')); { Recipient list is computed from To, Cc and Bcc fields } SslSmtpClient.RcptName.Clear; //SslSmtpClient.RcptNameAdd(ToEdit.Text, CcEdit.Text, BccEdit.text); SslSmtpClient.RcptNameAdd(DataBase_Mail.GetTrimString('COWN1EMAIL'), DataBase_Mail.GetTrimString('COWN2EMAIL'), ''); Display('Connecting to SMTP server...'); { Start first operation to do to send an email } { Next operations are started from OnRequestDone event } //BuildRcptList; //SendNextEmail; SslSmtpClient.Connect; end; {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} procedure TEMail_Send.SslSmtpClientRequestDone(Sender: TObject; RqType: TSmtpRequest; ErrorCode: Word); begin { For every operation, we display the status } if (Error > 0) and (Error < 10000) then Display('RequestDone Rq=' + IntToStr(Ord(RqType)) + ' Error='+ SslSmtpClient.ErrorMessage) else Display('RequestDone Rq=' + IntToStr(Ord(RqType)) + ' Error='+ IntToStr(Error)); { Check if the user has asked for "All-In-One" demo } if not FAllInOneFlag then Exit; { No, nothing more to do here } { We are in "All-In-One" demo, start next operation } { But first check if previous one was OK } if Error <> 0 then begin FAllInOneFlag := FALSE; { Terminate All-In-One demo } Display('Error, stoped All-In-One demo'); Exit; end; case RqType of smtpConnect: begin if SslSmtpClient.AuthType = smtpAuthNone then SslSmtpClient.Helo else SslSmtpClient.Ehlo; end; smtpHelo: SslSmtpClient.MailFrom; smtpEhlo: if SslSmtpClient.SslType = smtpTlsExplicit then begin Inc(FEhloCount); if FEhloCount = 1 then SslSmtpClient.StartTls else if FEhloCount > 1 then SslSmtpClient.Auth; end else SslSmtpClient.Auth; smtpStartTls: SslSmtpClient.Ehlo; // We need to re-issue the Ehlo command smtpAuth: SslSmtpClient.MailFrom; smtpMailFrom: SslSmtpClient.RcptTo; smtpRcptTo: SslSmtpClient.Data; smtpData: if DataBase_Mail.Eof then begin SslSmtpClient.Quit; Display('Mail Done !'); end else begin if nSentCount = 0 then begin nSentCount := (nSentCount+1); SentCount.Caption := IntToStr(nSentCount); end; SendNextRecord; end; smtpQuit: if DataBase_Mail.Eof then begin Display('Mail Done !'); end; //else // begin // SendNextRecord; // end; end; {*******************************************************************} end; {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} procedure TEMail_Send.SendNextRecord; begin ShowMessage('Start Test'); Delay(2000); ShowMessage('End Test'); DataBase_Mail.Skip(1); if not DataBase_Mail.Eof then begin FAllInOneFlag := True; SslSmtpClient.RcptName.Clear; SslSmtpClient.RcptNameAdd(Trim(DataBase_Mail.GetTrimString('COWN1EMAIL')), Trim(DataBase_Mail.GetTrimString('COWN2EMAIL')), ''); SslSmtpClient.HdrFrom := wDataBase_Cfg.GetTrimString('CFROM'); SslSmtpClient.HdrTo := DataBase_Mail.GetTrimString('COWN1EMAIL'); SslSmtpClient.HdrCc := DataBase_Mail.GetTrimString('COWN2EMAIL'); SslSmtpClient.HdrSubject := DataBase_EMailText.GetString('CSUBLINE'); SslSmtpClient.SignOn := wDataBase_Cfg.GetTrimString('CSIGNON'); SslSmtpClient.FromName := wDataBase_Cfg.GetTrimString('CFROM'); SslSmtpClient.EmailFiles := nil; // FileAttachMemo.Lines; SslSmtpClient.Host := wDataBase_Cfg.GetTrimString('CHOST'); SslSmtpClient.Port := wDataBase_Cfg.GetTrimString('CPORTHOST'); //SslSmtpClient.SendMode := smtpCopyToStream; SslSmtpClient.Mail; if nSentCount > 0 then begin nSentCount := (nSentCount+1); SentCount.Caption := IntToStr(nSentCount); end; end else exit; end; {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *}
  8. Angus, the example you are talking about is similar but different, your example does send out an email to multiple address but keeps the content of the email static, the program I am working on sends out a unique message to each recipient, by walking though a database, I have a somewhat working model however one small problem and not sure where it stems from, on the third iteration it hangs, does not give an error simply hangs. I was thinking it maybe a timing issue sending to much to the mail server to quickly. I was thinking that if I put in a small pause between each email it may resolve the issue. Can I send you a copy of the code for your review and recommendations? Thank you Will
  9. I have been looking over the sample program and was wondering if I am on the correct path, I was going to give the following a try but wanted some input first. I was thinking that I can send the next email by using the ClientRequestDone event. I made my additions in bold text so you can see them. {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} procedure TSslSmtpTestForm.SslSmtpClientRequestDone( Sender : TObject; RqType : TSmtpRequest; Error : Word); begin { For every operation, we display the status } if (Error > 0) and (Error < 10000) then Display('RequestDone Rq=' + IntToStr(Ord(RqType)) + ' Error='+ SslSmtpClient.ErrorMessage) else Display('RequestDone Rq=' + IntToStr(Ord(RqType)) + ' Error='+ IntToStr(Error)); { Check if the user has asked for "All-In-One" demo } if not FAllInOneFlag then Exit; { No, nothing more to do here } { We are in "All-In-One" demo, start next operation } { But first check if previous one was OK } if Error <> 0 then begin FAllInOneFlag := FALSE; { Terminate All-In-One demo } Display('Error, stoped All-In-One demo'); Exit; end; case RqType of smtpConnect: begin if SslSmtpClient.AuthType = smtpAuthNone then SslSmtpClient.Helo else SslSmtpClient.Ehlo; end; smtpHelo: SslSmtpClient.MailFrom; smtpEhlo: if SslSmtpClient.SslType = smtpTlsExplicit then begin Inc(FEhloCount); if FEhloCount = 1 then SslSmtpClient.StartTls else if FEhloCount > 1 then SslSmtpClient.Auth; end else SslSmtpClient.Auth; smtpStartTls: SslSmtpClient.Ehlo; // We need to re-issue the Ehlo command smtpAuth: SslSmtpClient.MailFrom; smtpMailFrom: SslSmtpClient.RcptTo; smtpRcptTo: SslSmtpClient.Data; {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} // Check database for EOF if True then finish smtpData: SslSmtpClient.Quit; smtpQuit: Display('All-In-One done !'); exit; {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} end; {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} // Send next email // Get next record reload component and send SslSmtpClient.RcptName.Clear; SslSmtpClient.RcptNameAdd(ToEdit.Text, CcEdit.Text, BccEdit.text); SslSmtpClient.HdrFrom := FromEdit.Text; SslSmtpClient.HdrTo := ToEdit.Text; SslSmtpClient.HdrCc := CcEdit.Text; SslSmtpClient.HdrSubject := SubjectEdit.Text; SslSmtpClient.SignOn := SignOnEdit.Text; SslSmtpClient.FromName := FromEdit.Text; SslSmtpClient.EmailFiles := FileAttachMemo.Lines; SslSmtpClient.SendMode := smtpCopyToStream; SslSmtpClient.Mail; {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} end;
  10. Thank you, I have gotten past that now a new problem, I just made a new topic.
  11. I am trying to create an email program that will send a email to mutable email addresses by reading in a database file and sending out a email / newsletter to each record in the database. (for my wife's sewing club) I have been using the "OverbyteIcsSslMailSnd" sample / demo program as an guide. Everything works correctly if I select a record and the send the email. The problem I am having is trying to figure out a way to send the email to each listed email in the database automatically. I can not find a direct means to send the batch of emails, I was thinking that if within the "All In One" button I added a while loop to repeat the process until the database is empty, however that did not work. So next I tried was to add a test button that calls the "All In One" button using the .click method of the button. Procedure Newbutton Database gotop while not database.eof do begin allinonebutton.click; skip database one record; end; The problem I am having on the second loop "Record 2" I receive a error "SMTP Component not ready". I am thinking that I may need some sort of a delay timer between iterations. What am I overlooking? Thanks Will
  12. I have been unable to determine requirements that smtp.aol.com is looking for. I am using the follwing: Server Address: smtp.aol.com. Username: Your AOL Mail screen name (e.g. whatever comes before @aol.com) Password: Your AOL Mail password. Port Number: 587 (With TLS) Alternative Port Number: 465 (With SSL) Authentication: Required. However I cannot make a connection to send an email. I think that AOL is using a Yahoo backbone but not to sure. Any ideas on what I am overlooking? Thanks
  13. Just found this in my spam folder. Delivery has failed to these recipients: xxxxxxx@aol.com Subject: Delphi Download Password Request Remote Server returned: '554 5.7.9 Message not accepted for policy reasons. See https://help.yahoo.com/kb/postmaster/SLN7253.html'
  14. Ok, this is my confirmation from the server. Your request has been sent and you should receive a copy delivered to your mailbox within a few minutes. If the email does not arrive, this is probably because you have entered an incorrect email address, so you should return to the form and check the address, otherwise you probably won't receive the password email either.
×