1

Closed

text file as an attachment

description

Following code throws ArgumentNullException
using (SmtpClient client = new HigLabo.Net.Smtp.SmtpClient(smtpServer, smtpPort, userName, password))
{
    var msg = new SmtpMessage(fromEmail, toEmail, cc ?? "", subject ?? "", body ?? "");
    
    var attach = new SmtpContent();
    attach.LoadFileData(@"c:\textfile.txt");
    msg.Contents.Add(attach);

    var res = client.SendMail(msg); //exception here
}
Closed Jan 30, 2015 at 12:02 AM by higty

comments

higty wrote Jan 29, 2015 at 11:58 PM

Hi.

Thank you for your bug report.
I modified this bug and check-in fixed version.

regards.

wrote Jan 30, 2015 at 12:02 AM