Send Email with attachment file
With the few line of codes you can send an e-Mail with attachment file. via .net application
Dim data As New Attachment(strFileName, System.Net.Mime.MediaTypeNames.Application.Octet)
‘Add time stamp information for the file.
Dim disposition As System.Net.Mime.ContentDisposition
disposition = data.ContentDisposition
disposition.CreationDate = System.IO.File.GetCreationTime(strFileName)
disposition.ModificationDate = System.IO.File.GetLastWriteTime(strFileName)
disposition.ReadDate = System.IO.File.GetLastAccessTime(strFileName)
‘ Add the file attachment to this e-mail message.
myMessage.Attachments.Add(data)
myMessage.Priority = MailPriority.High
‘Send the message.
Dim client As New System.Net.Mail.SmtpClient(“10.0.0.27″)
‘Add credentials if the SMTP server requires them.
client.Credentials = New System.Net.NetworkCredential(“matef”, “123″)
client.Send(myMessage)
-
Archives
- May 2011 (2)
- January 2011 (2)
- December 2010 (1)
- September 2010 (8)
- August 2010 (1)
- March 2010 (1)
- November 2009 (1)
- October 2009 (3)
- September 2009 (2)
- August 2009 (1)
- July 2009 (7)
- June 2009 (10)
-
Categories
-
RSS
Entries RSS
Comments RSS

