mailMessage.Attachments.Add() to send translation file
help needed, I need to send the translation file using the umbraco built in xml generatoras in "/umbraco/translation/xml.aspx?id=111" and to send the xml file as an email attachment.
Is there any ways that I can send out the xml translation file through email without downloading it to the disk?
Appreciate if there is any help or guide.
Thanks
Details on the code as below
var mailMessage = new MailMessage(fromEmailAddress, toEmailAddress)
{
Subject = subject,
SubjectEncoding = Encoding.UTF8,
Body = RenderEmailTemplate(),
BodyEncoding = Encoding.UTF8,
IsBodyHtml = true
};
mailMessage.Attachments.Add(GetAttachment());
var smtp = new SmtpClient();
smtp.Send(mailMessage);
private Attachment GetAttachment() {
Attachment data = new Attachment(MapPath("/umbraco/translation/xml.aspx?id=111"), MediaTypeNames.Application.Octet);
mailMessage.Attachments.Add() to send translation file
help needed, I need to send the translation file using the umbraco built in xml generatoras in "/umbraco/translation/xml.aspx?id=111" and to send the xml file as an email attachment.
Is there any ways that I can send out the xml translation file through email without downloading it to the disk?
Appreciate if there is any help or guide.
Thanks
Details on the code as below
var mailMessage = new MailMessage(fromEmailAddress, toEmailAddress)
{
Subject = subject,
SubjectEncoding = Encoding.UTF8,
Body = RenderEmailTemplate(),
BodyEncoding = Encoding.UTF8,
IsBodyHtml = true
};
mailMessage.Attachments.Add(GetAttachment());
var smtp = new SmtpClient();
smtp.Send(mailMessage);
private Attachment GetAttachment()
{
Attachment data = new Attachment(MapPath("/umbraco/translation/xml.aspx?id=111"), MediaTypeNames.Application.Octet);
return data;
}
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.