C# Code snippet to send an Email with attachment from Outlook, Yahoo, HotMail, AOL and Gmail[
^]
<pre>using System.Text;
private void GetAttachmentsInfo(Outlook.MailItem email)
{
StringBuilder attachmentInfo = new StringBuilder();
Outlook.Attachments mailAttachments = email.Attachments;
if (mailAttachments != null)
{
for (int i = 1; i < = mailAttachments.Count; i++)
{
Outlook.Attachment currentAttachment = mailAttachments.Item(i);
if (currentAttachment != null)
{
attachmentInfo.AppendFormat(
"#{0}\n\rFile name: {1}\n\rDisplay Name: {2}\n\rType: {3}\n\n\r",
i, currentAttachment.FileName, currentAttachment.DisplayName,
currentAttachment.Type);
Marshal.ReleaseComObject(currentAttachment);
}
}
if (attachmentInfo.Length > 0)
System.Windows.Forms.MessageBox.Show(
attachmentInfo.ToString(), "E-mail attachments");
Marshal.ReleaseComObject(mailAttachments);
}
}
from both you can drive out what you need....