Function CSPMime::Add()

Description:
Adds a MIME part (such as an attachment) to the MIME object.

Prototype:
bool Add(const CSPMimePart& Part);

Arguments:
  • const CSPMimePart& Part [IN]
    The MIME Part to add (such as and attachment).



Return value:
If successful, it returns true. Otherwise, it returns false.

Examples:
CSPMimePart PartMessage;
CSPMimePart PartAttachment;
CSPMime Mime;
CSPBuffer AttachmentData;
CSPMail Mail;
...
...
PartMessage.Data = CSPString( "Here is the attached image" );
PartMessage.ContentType = "text/plain";
PartMessage.Encoding = CSPPartMime::ENC_7BIT;

PartAttachment.Data = AttachmentData;
PartAttachment.ContentType = "image/jpeg";
PartAttachment.Disposition = CSPMimePart::DISP_ATTACHMENT;
PartAttachment.Encoding = CSPPartMime::ENC_BASE64;

Mime.Add( PartMessage );
Mime.Add( PartAttachment );

Mail.Send( Mime );

See also:
member function Clear(), Render(), GetOutput(), Get(), GetCount()
CSPMime | Other support classes | Class Categories | Online help home | Back

www.micronovae.com

Copyright © 2002 - 2005 Micronovae Ltd