Thread View: borland.public.cppbuilder.internet.socket
5 messages
5 total messages
Started by Derek Harvey
Wed, 05 Mar 2008 13:36
Need help on email from BCB
Author: Derek Harvey
Date: Wed, 05 Mar 2008 13:36
Date: Wed, 05 Mar 2008 13:36
20 lines
1648 bytes
1648 bytes
Hi Folks, I want to add a simple emailer to my program but am finding it hard to find a way into the facilities BCB2007 might offer towards this aim, e.g., what components do I use and how. This is so important these days that I am surprised there are no samples of such things provided with the project. Later I will want FTP. In the Help there is a vast collection of items for TIdSMTP, etc. but no easy way into this morass of information. Does anyone know of a sample program I can build on? In BCB6 there were some components in a group FastNet which seemed quite easy to use but I don't find them in BCB2007. What would happen if I moved a small FTP program I wrote as an experiment into 2007? Well, I could try, I suppose. Anby help welcomed. TIA Derek
Re: Need help on email from BCB
Author: Remy Lebeau (TeamB)
Date: Wed, 05 Mar 2008 18:00
Date: Wed, 05 Mar 2008 18:00
21 lines
1520 bytes
1520 bytes
"Derek Harvey" <newsbox1@dvharvey.me.uk> wrote in message news:47cea1cb$1@newsgroups.borland.com... > Does anyone know of a sample program I can build on? TIdSMTP is an Indy component. Have a look at the demos on Indy's website (http://www.indyproject.org). > In BCB6 there were some components in a group FastNet > which seemed quite easy to use but I don't find them in BCB2007. Borland dropped NetMasters a long time ago. > What would happen if I moved a small FTP program I wrote as > an experiment into 2007? Well, I could try, I suppose. Indy has a TIdFTP component as well. Gambit
Re: Need help on email from BCB
Author: Joe Pasquariello
Date: Wed, 05 Mar 2008 18:33
Date: Wed, 05 Mar 2008 18:33
60 lines
3277 bytes
3277 bytes
Derek, The simplest way to send email with Indy is to use function IdSMTP::QuickSend(). The code below is from a little test program I wrote for CB2007. No need to put an Indy objects on your form. I just put some TEdit objects to allow entering the various fields for QuickSend(), use the #include as shown below, and call the function. If you need attachments or additional features, you'll have to get into Indy in more detail. FYI, the version of Indy that is installed with CB2007 is fairly old. You will see many recommendations on this group to update to the newest snapshot, but there's no documented procedure, so it's not very easy to do. If you are doing very simple stuff, like this, you may be able to limp along with this version, otherwise you'll have to try to piece together an update procedure from messages on this group. According to David of Codegear, the next release of CB will include an up-to-date and relatively bug-free version of Indy. Joe #include <IdSMTP.hpp> // IdSMTP::QuickSend() AnsiString Host = HostEdit->Text; AnsiString Subject = SubjectEdit->Text; AnsiString To = ToEdit->Text; AnsiString From = FromEdit->Text; AnsiString Body = BodyMemo->Text; // Note that some (static?) INDY functions require an additional (first) // argument as used below when called from C++Builder. Note also that // QuickSend() function does not require a pre-existing TIdSMTP object. TIdSMTP::QuickSend( __classid(TIdSMTP), Host, Subject, To, From, Body ); Derek Harvey wrote: > Hi Folks, > I want to add a simple emailer to my program but am finding it hard to find > a way into the facilities BCB2007 might offer towards this aim, e.g., what > components do I use and how. This is so important these days that I am > surprised there are no samples of such things provided with the project. > Later I will want FTP. > > In the Help there is a vast collection of items for TIdSMTP, etc. but no > easy way into this morass of information. > > Does anyone know of a sample program I can build on? > > In BCB6 there were some components in a group FastNet which seemed quite > easy to use but I don't find them in BCB2007. What would happen if I moved a > small FTP program I wrote as an experiment into 2007? Well, I could try, I > suppose. > > Anby help welcomed. > TIA > Derek > >
Re: Need help on email from BCB
Author: Derek Harvey
Date: Wed, 05 Mar 2008 20:42
Date: Wed, 05 Mar 2008 20:42
69 lines
3738 bytes
3738 bytes
Thanks Joe. That could be a good start. However, I already tried #include <IdSMTP.hpp> in a form and get many errors of the form Ambiguity between USHORT and Fdi::USHORT in files inaddr.h, ws2def.h and wsnwlink.h Any idea how I resolve that? What's Fdi? Derek "Joe Pasquariello" <joep@fenway.com> wrote in message news:47cee75d$1@newsgroups.borland.com... > Derek, > > The simplest way to send email with Indy is to use function > IdSMTP::QuickSend(). The code below is from a little test > program I wrote for CB2007. No need to put an Indy objects > on your form. I just put some TEdit objects to allow entering > the various fields for QuickSend(), use the #include as > shown below, and call the function. If you need attachments > or additional features, you'll have to get into Indy in more > detail. FYI, the version of Indy that is installed with CB2007 > is fairly old. You will see many recommendations on this group > to update to the newest snapshot, but there's no documented > procedure, so it's not very easy to do. If you are doing very > simple stuff, like this, you may be able to limp along with > this version, otherwise you'll have to try to piece together > an update procedure from messages on this group. According to > David of Codegear, the next release of CB will include an > up-to-date and relatively bug-free version of Indy. > > Joe > > > #include <IdSMTP.hpp> // IdSMTP::QuickSend() > > AnsiString Host = HostEdit->Text; > AnsiString Subject = SubjectEdit->Text; > AnsiString To = ToEdit->Text; > AnsiString From = FromEdit->Text; > AnsiString Body = BodyMemo->Text; > > // Note that some (static?) INDY functions require an additional (first) > // argument as used below when called from C++Builder. Note also that > // QuickSend() function does not require a pre-existing TIdSMTP object. > TIdSMTP::QuickSend( __classid(TIdSMTP), Host, Subject, To, From, Body ); > > > > Derek Harvey wrote: >> Hi Folks, >> I want to add a simple emailer to my program but am finding it hard to >> find a way into the facilities BCB2007 might offer towards this aim, >> e.g., what components do I use and how. This is so important these days >> that I am surprised there are no samples of such things provided with the >> project. Later I will want FTP. >> >> In the Help there is a vast collection of items for TIdSMTP, etc. but no >> easy way into this morass of information. >> >> Does anyone know of a sample program I can build on? >> >> In BCB6 there were some components in a group FastNet which seemed quite >> easy to use but I don't find them in BCB2007. What would happen if I >> moved a small FTP program I wrote as an experiment into 2007? Well, I >> could try, I suppose. >> >> Anby help welcomed. >> TIA >> Derek
Re: Need help on email from BCB
Author: Remy Lebeau (TeamB)
Date: Wed, 05 Mar 2008 21:45
Date: Wed, 05 Mar 2008 21:45
19 lines
1669 bytes
1669 bytes
"Derek Harvey" <newsbox1@dvharvey.me.uk> wrote in message news:47cf05c3$1@newsgroups.borland.com... > However, I already tried #include <IdSMTP.hpp> in a > form and get many errors of the form > Ambiguity between USHORT and Fdi::USHORT > in files inaddr.h, ws2def.h and wsnwlink.h You have a library/package installed that is defining its own data types using the same names that the Win32 API uses, thus there are naming conflicts. That has nothing to do with Indy itself. > What's Fdi? A namespace that the library/package is defining its data types in. Gambit
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads