Article View: borland.public.cppbuilder.internet.socket
Article #498Re: Need help on email from BCB
From: 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
Technical Details
Message-ID:
<47cf05c3$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<47cea1cb$1@newsgroups.borland.com> <47cee75d$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,a96ad1efe07bc68c X-Google-Attributes: gid11508e,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Derek Harvey" <newsbox1@dvharvey.me.uk> Newsgroups: borland.public.cppbuilder.internet.socket References: <47cea1cb$1@newsgroups.borland.com> <47cee75d$1@newsgroups.borland.com> Subject: Re: Need help on email from BCB Date: Wed, 5 Mar 2008 20:42:54 -0000 Lines: 71 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 86.146.118.151 Message-ID: <47cf05c3$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1204749763 86.146.118.151 (5 Mar 2008 12:42:43 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail