I am using the MailMessage class to send emails, and I am using the following code to add attachments that will be part of the email, like the button, company logo and a few more. However, I wish these attachments are not sent to the recipient, and that is what is happening. Has anyone ever experienced this? Or is there any way you can not send the attachments? Here is the code I use:
public static MailMessage GetLogoEmailEmpresa(string corpo)
{
MailMessage msg = new MailMessage();
AlternateView htmlView = AlternateView.CreateAlternateViewFromString(corpo,null,"text/html");
LinkedResource logoCompany = null;
LinkedResource btnEN = null;
logoCompany = new LinkedResource("../../../../../../WorkerRole/Resources/Images/logoCompany.png");
logoCompany.ContentId = "logoCompany";
htmlView.LinkedResources.Add(logoCompany)
btnEN.ContentId = "botaoEn";
htmlView.LinkedResources.Add(btnEN);
msg.AlternateViews.Add(htmlView);
return msg;
}