Forums: Email - New Data , CC, BCC, HTML - Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Email - New Data , CC, BCC, HTML Email - New Data , CC, BCC, HTML Rate Topic: -----

#1 User is offline   swat 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 316
  • Joined: 18-June 03

Posted 16 February 2018 - 01:12 PM

On event options, send email with new data, how I can add CC,BCC to the email function? Also, I want to use some html/table code for the budy section. How I can do that?
0

#2 User is offline   MK Frank R 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 40
  • Joined: 24-May 11

Posted 16 February 2018 - 01:27 PM

Here's a clip from my code.

Code the html in the email body, and use the keyword "htmlbody" for it.


Quote

//------------------------------------------------------------------------------------------------------------------------
// Send the email
//------------------------------------------------------------------------------------------------------------------------
XVar EmailStatus;
MVCFunctions.runner_mail(new XVar("to", ToAddresses, "subject", EmailSubject, "htmlbody", EmailBody, "from", FromAddress));


0

#3 User is offline   timnorvel 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 248
  • Joined: 21-September 07

Posted 16 February 2018 - 02:35 PM

Just for some more examples for you, here is one that I do. You can see that I build the HTML message with a combination of a field on the page, some hard-coded HTML , and some data from a master table. I also have a CC. You can do the same thing with Bcc.



	XVar data = pageObject.getMasterRecord();
	string email = values["SendTo"].Replace(",,",",").ToString().TrimEnd(",,".ToCharArray());
	string from = "myemail@mydomain.com";
	string cc = values["Cc"].ToString() ;
	string msg = values["Note"].ToString() + "<br><br><hr><br>Original request:<br>  " + data["Request"].ToString() ;
	string subject = data["Subject"].ToString() + " - Note added to ticket: " + values["TicketID"].ToString();
	XVar result;
	result = MVCFunctions.runner_mail(new XVar("to", email, "cc", cc, "subject", subject, "htmlbody", msg, "from", from));
	if(!result["mailed"])
	{
		MVCFunctions.EchoToOutput(result["message"]);
	}


0

#4 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 15771
  • Joined: 03-February 03

Posted 16 February 2018 - 02:48 PM

ASPRunner.NET manual explains how to add CC, BCC and also how to send HTML emails:
https://xlinesoft.co...il_function.htm
Best regards,
Sergey Kornilov
0

#5 User is offline   swat 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 316
  • Joined: 18-June 03

Posted 19 February 2018 - 06:39 AM

View Postadmin, on 16 February 2018 - 03:48 PM, said:

ASPRunner.NET manual explains how to add CC, BCC and also how to send HTML emails:
https://xlinesoft.co...il_function.htm


I am using the code sample on "public XVar AfterEdit", It looks good , but if I use "data["Subject"].ToString()" then I am getting an error "null ref"
0

#6 User is offline   swat 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 316
  • Joined: 18-June 03

Posted 22 February 2018 - 06:44 AM

In addition also, I am getting an value("ID") on the edit page and using this ID value I need to get email address from another table. I am getting that query as well, but how I can seperate the 4-5 email address from here to email sending function?



XVar EmailCC = tDAL.DBLookup("SELECT [Email1],EMail2,Email3,Email4 FROM [Contact] WHERE ID='" + values["ID"].ToString() + "'");
XVar data = pageObject.getMasterRecord();
string email = EmailCC;
0

#7 User is offline   swat 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 316
  • Joined: 18-June 03

Posted 06 March 2018 - 05:58 AM

Is it possible to get the email address from Active Directory base on the session?
0

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked