Recent

Author Topic: Sending Email with Indy  (Read 6167 times)

hugoengel2003

  • New member
  • *
  • Posts: 8
Sending Email with Indy
« on: May 16, 2014, 06:44:33 am »
I tried so hard to make a sending email aplication with Indy, but I didn't get!
Please, help-me!

JanRoza

  • Hero Member
  • *****
  • Posts: 672
    • http://www.silentwings.nl
Re: Sending Email with Indy
« Reply #1 on: May 16, 2014, 12:16:42 pm »
What version of Windows, Lazarus, FPC?
What have you tried so far, show your project so people know what you did and what is wrong.
Crystal balls are rare these days  :D
OS: Windows 10 (64 bit) / Linux Mint (64 bit)
       Lazarus 3.2 FPC 3.2.2
       CodeTyphon 8.40 FPC 3.3.1

Paul Breneman

  • Sr. Member
  • ****
  • Posts: 290
    • Control Pascal
Re: Sending Email with Indy
« Reply #2 on: May 16, 2014, 12:35:14 pm »
It isn't Indy, but here is a two year old Free Pascal example using Synapse that might be helpful:
http://turbocontrol.com/easyemail.htm
Regards,
Paul Breneman
www.ControlPascal.com

ChrisF

  • Hero Member
  • *****
  • Posts: 542
Re: Sending Email with Indy
« Reply #3 on: May 16, 2014, 02:30:01 pm »
Here is a simple test program.

This example is using directly the TIdSMTP class of Indy, but using  the corresponding visual component of Indy instead is of course also possible: see "Indy Clients Protocols (nz)" panel in the IDE component palette.

Fields that must absolutely be changed in this sample (in "TForm1.Button2Click" code):

-IdMessage.Recipients.EmailAddresses : must have a valid recipient email address

-IdSMTP.Host: probably your own SMTP server (i.e. SMTP server of your ISP)

-IdSMTP.Port: eventually, the port number of the targeted SMTP server (25 in this sample)

Change the other fields according to your own needs.


** EDIT (2014-06-09) ** : Updated version for this sample. Indy dependency has been added to the test project for portable consideration (direct path to Indy library no more needed).
« Last Edit: June 09, 2014, 02:44:02 pm by ChrisF »

mica

  • Full Member
  • ***
  • Posts: 196
Re: Sending Email with Indy
« Reply #4 on: May 16, 2014, 03:41:23 pm »
not Indy but Synapse

uses .....smtpsend....

SendToEx( MailFrom, MailTo, Subject, SMTPHost, MailData,  Username, Password)

http://synapse.ararat.cz/doc/help/smtpsend.html

 

TinyPortal © 2005-2018