Article View: borland.public.cppbuilder.internet.socket
Article #932Re: Attachment missing from email
From: Royce
Date: Fri, 07 Sep 2007 21:39
Date: Fri, 07 Sep 2007 21:39
86 lines
3270 bytes
3270 bytes
"Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> wrote:
>
>"Royce" <rfessenden@dmp.com> wrote in message
>news:46e19c52$1@newsgroups.borland.com...
>
>> Is there any other information I might be able to provide that might help?
>
>Please show the exact code you are using now.
>
>
>Gambit
>
>
>
int TMainForm::TestFunction(void)
{
AnsiString FileToAttach = "C:\\Link\\Logs\\Logs.zip";
if( !FileExists(FileToAttach) )
{
Log->Lines->Add("File <" + FileToAttach + "> does not exist.");
return -1;
}
Log->Lines->Add("Attaching file " + FileToAttach);
TDMPCursor MyCursor(crHourGlass);
MailMessage->ContentType = "multipart/mixed";
TIdText* txt = new TIdText(MailMessage->MessageParts, NULL);
txt->ContentType = "text/plain";
txt->Body->Append("txt With zips attached.");
TIdAttachment* LogFile = new TIdAttachment(MailMessage->MessageParts, FileToAttach);
LogFile->FileName = ExtractFileName(FileToAttach);
//LogFile->ContentType = GetMIMETypeFromFile(LogFile->FileName);
LogFile->ContentType = "application/zip";
SMTPClient->Connect();
try
{
SMTPClient->Send(MailMessage);
}
__finally
{
SMTPClient->Disconnect();
}
Log->Lines->Add("TestFunction Completed");
return 0;
}
The .dfm settings of the components are as follows:
object SMTPClient: TIdSMTP
MaxLineAction = maException
Host = 'mail.dmp.com'
Port = 25
AuthenticationType = atNone
HeloName = 'Link'
Password = 'xxxxxx'
Username = 'engtesting'
Left = 176
Top = 52
end
object MailMessage: TIdMessage
AttachmentEncoding = 'MIME'
BccList = <>
CCList = <>
ContentType = 'Application/Zip'
ContentTransferEncoding = 'Base64'
Encoding = meMIME
From.Address = 'engtesting@dmp.com'
From.Name = 'engtesting'
From.Text = 'engtesting <engtesting@dmp.com>'
Recipients = <
item
Address = 'rfessenden@dmp.com'
Name = 'Royce'
Text = 'Royce <rfessenden@dmp.com>'
end>
ReplyTo = <>
Subject = 'Email via Link'
Left = 176
Top = 104
end
Technical Details
Message-ID:
<46e1c522$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<46e03084$1@newsgroups.borland.com> <46e044e4$1@newsgroups.borland.com> <46e06fc0$1@newsgroups.borland.com> <46e071bf$1@newsgroups.borland.com> <46e19c52$1@newsgroups.borland.com> <46e1a510@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,57b1f9f1187ccd3f X-Google-Attributes: gid11508e,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Royce" <rfessenden@dmp.com> Sender: "Royce" <rfessenden@dmp.com> Reply-To: "Royce" <rfessenden@dmp.com> Subject: Re: Attachment missing from email Newsgroups: borland.public.cppbuilder.internet.socket X-User-Info: 209.248.148.58 References: <46e03084$1@newsgroups.borland.com> <46e044e4$1@newsgroups.borland.com> <46e06fc0$1@newsgroups.borland.com> <46e071bf$1@newsgroups.borland.com> <46e19c52$1@newsgroups.borland.com> <46e1a510@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <46e1c522$1@newsgroups.borland.com> Date: 7 Sep 2007 14:39:46 -0700 X-Trace: newsgroups.borland.com 1189201186 207.105.83.66 (7 Sep 2007 14:39:46 -0700) Lines: 87 Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail X-Original-Bytes: 3127