Article View: borland.public.cppbuilder.internet.socket
Article #1018Indy TidSMTP component
From: Terry Neckar
Date: Tue, 26 Jun 2007 15:56
Date: Tue, 26 Jun 2007 15:56
62 lines
2615 bytes
2615 bytes
I'm running Borland Developer Studio 2006. I have a program that looks at
error data from a hardware device. It is always running and checking for
data. Upon finding it, it sends an email with an attachment. First time
around, it sends the attachment fine. Any subsequent cycles, it gets an
EAccess Violation when preparing the attachment. Here is a piece of my code.
-------------------------------------------------------
TIdAttachment *Attachment = new
TIdAttachment(MainForm->MailMessage->MessageParts, "Media.pdf");
MailMessage->Recipients->Add()->Address = joe@mail.com;
MailMessage->Subject = "My media report";
MailMessage->From->Name = "Johns Fish House";
MailMessage->From->Address = "admin@fishhouse.com";
MailMessage->Body->Clear();
MailMessage->Body->Add("This is an automatically generated email.");
SMTP->Host = "mail.fishhouse.com";
SMTP->Username = "mike";
try
{
SMTP->Connect();
}
catch (Exception& E)
{
LogErrorMessage(E.Message.c_str());
remove("Media.pdf");
free(Attachment);
LogErrorMessage("Connect email to specialist and CHE mail failed.");
return;
}
try
{
SMTP->Send(MailMessage);
}
catch (Exception& E)
{
LogErrorMessage(E.Message.c_str());
remove("Media.pdf");
free(Attachment);
LogErrorMessage("Send email to specialist and CHE mail failed.");
return;
}
-----------------------------------------------------------------
Here is the status messages:
Resolving Hostname mail.fishhouse.com.
Connecting to 45.222.47.123.
Connected.
EAccess Violation.
Disconnecting.
Disconnected.
-----------------------------------------------------------------
Thanks,
Terry
Technical Details
Message-ID:
<46813745$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 11508e,69af8efb47c65aa,start X-Google-Attributes: gid11508e,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Reply-To: "Terry Neckar" <tneckar@cheservice.com> From: "Terry Neckar" <tneckar@cheservice.com> Newsgroups: borland.public.cppbuilder.internet.socket Subject: Indy TidSMTP component Date: Tue, 26 Jun 2007 08:56:54 -0700 Lines: 64 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 NNTP-Posting-Host: 70.190.73.68 Message-ID: <46813745$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1182873413 70.190.73.68 (26 Jun 2007 08:56:53 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail