I have a string:
sring Result = "This is the string I want sent as a text file"
I have MailMessage:
MailMessage TestMail = new MailMessage();
TestMail.From = "larry.viezel@t mp.com";
TestMail.To = "larry.viezel@t mp.com";
TestMail.BodyFo rmat = MailFormat.Text ;
TestMail.Subjec t = "Test email";
TestMail.Body = "This would be the body of the email"
I want to add Result as a textfile attachement to the email. How can I
go about doing this? I would prefer if I didn't have to actually save
to the disk.
TestMail.Attach ments.Add(Resul t); //obviously this would be too
easy.
SmtpMail.Send(T estMail);
Any thoughts? Can I somehow cast this string into a MailAttachment as
if by magic?
Larry.
sring Result = "This is the string I want sent as a text file"
I have MailMessage:
MailMessage TestMail = new MailMessage();
TestMail.From = "larry.viezel@t mp.com";
TestMail.To = "larry.viezel@t mp.com";
TestMail.BodyFo rmat = MailFormat.Text ;
TestMail.Subjec t = "Test email";
TestMail.Body = "This would be the body of the email"
I want to add Result as a textfile attachement to the email. How can I
go about doing this? I would prefer if I didn't have to actually save
to the disk.
TestMail.Attach ments.Add(Resul t); //obviously this would be too
easy.
SmtpMail.Send(T estMail);
Any thoughts? Can I somehow cast this string into a MailAttachment as
if by magic?
Larry.
Comment