You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reported by rkmoray on 2018-07-25 12:53 UTC
I amd trying to add an attachment to an email, When the add attachment line is read, I get an object error.
Here is the code
var mymessage = new MimeMailMessage
{
From = new MimeMailAddress(Mail),
Subject = "Web Purchase Receipt " + DateTime.Now.ToString("yyyyMMdd"),
Body = "body"
};
mymessage.To.Add("me@hotmail.com");
var mailer = new MimeMailer(Host, 465)
{
User = User,
Password = Pass,
EnableImplicitSsl = true,
AuthenticationMode = AuthenticationType.Base64
};
var a = new MimeAttachment("c:\temp\Integra POS.pdf")
{
//ContentType = new ContentType("application/pdf"),
ContentType = new ContentType("application/octet-stream"),
Location = AttachmentLocation.Inline
};
AttachList.Add(a);
foreach (Attachment t in AttachList)
{
mailer.MailMessage.Attachments.Add((MimeAttachment)t);//Error on the line
}
((SmtpSocketClient)mailer).SslType = SslMode.Ssl;
mailer.SendCompleted += SendCompleted;
mailer.SendMailAsync(mymessage);
The text was updated successfully, but these errors were encountered:
Reported by rkmoray on 2018-07-25 12:53 UTC
I amd trying to add an attachment to an email, When the add attachment line is read, I get an object error.
Here is the code
var mymessage = new MimeMailMessage
{
From = new MimeMailAddress(Mail),
Subject = "Web Purchase Receipt " + DateTime.Now.ToString("yyyyMMdd"),
Body = "body"
};
mymessage.To.Add("me@hotmail.com");
var mailer = new MimeMailer(Host, 465)
{
User = User,
Password = Pass,
EnableImplicitSsl = true,
AuthenticationMode = AuthenticationType.Base64
};
var a = new MimeAttachment("c:\temp\Integra POS.pdf")
{
//ContentType = new ContentType("application/pdf"),
ContentType = new ContentType("application/octet-stream"),
The text was updated successfully, but these errors were encountered: