This topic is locked

Add attachment in Emai option

2/8/2014 1:12:21 PM
ASPRunner.NET General questions
M
Michaelr05 author

Love the new interface.
One question..... using your send email function, do you have an attribute in ytour mailing function to attach a document or multiple documents to the email. Below is your basic generic code for ssending a new email after an add.
================

//** Send email with new data ****
string email = "test@test.com";

string from = "admin@test.com";

StringBuilder msg = new StringBuilder("");

string subject = "New data record";
foreach(var field in values.GetEnumerator())

{

if(!CommonFunctions.IsBinaryType(pageObject.pSet.getFieldType(field.Key)))

{

msg.Append(field.Key.ToString() + " : " + field.Value.ToString() + "\r\n");

}

}
XVar ret = MVCFunctions.runner_mail(new XVar("to", email, "subject", subject, "body", msg.ToString(), "from", from));

if(!ret["mailed"])

{

MVCFunctions.EchoToOutput(ret["message"]);

}
==============================
Thank you in advance.
Rizzy

Sergey Kornilov admin 2/21/2014

Rizzy,
in ASPRunner.NET 7.0 manual check Advanced topics->Programming topics->runner_mail function article. The very last example shows how to attach files.