![]() Display the values in the ContentDisposition for the attachment.ĬontentDisposition^ cd = data->ContentDisposition Ĭonsole::WriteLine( L"Content disposition" ) Ĭonsole::WriteLine( L"File ", d.Key, d.Value) Add credentials if the SMTP server requires them.Ĭlient->Credentials = CredentialCache::DefaultNetworkCredentials SmtpClient^ client = gcnew SmtpClient( server ) Add the file attachment to this email message. Add time stamp information for the file.ĬontentDisposition^ disposition = data->ContentDisposition ĭisposition->CreationDate = System::IO::File::GetCreationTime( file ) ĭisposition->ModificationDate = System::IO::File::GetLastWriteTime( file ) ĭisposition->ReadDate = System::IO::File::GetLastAccessTime( file ) Create the file attachment for this email message.Īttachment^ data = gcnew Attachment(file, MediaTypeNames::Application::Octet) MailMessage^ message = gcnew MailMessage( data report.",L"See the attached spreadsheet." ) Create a message and set up the recipients. ![]() ![]() This example assumes that a file named Data.xls exists in the Specify the file to be attached and sent. static void CreateMessageWithAttachment( String^ server ) The following code example demonstrates creating and sending an email message that includes an attachment.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |