scot1967
Champion Level 1
17 days agoI have this code set in an event in all of my test complete projects. It is controlled by a bool variable in the project. You will need to ensure you have permission on a local server to do this.
P.S. If you find my posts helpful give me a like and be sure to mark a 'Best Answer' to give credit and help others with the same questions!
function Email_Event (str_Message = "No Test Message Supplied. ")
{
if (Project.Variables.bEvent_Email){
SendEmail( /*Recipient*/
Project.Variables.strEmail_Rcpt,
/*Mail Server*/
"mail.wwwoodproducts.com",
/*Senders Name*/
"TestComplete",
/*Senders Address*/
"Testing@wwinc.com",
/*Subject*/
"WWCabinetOrder, Test Case: " + aqTestCase.CurrentTestCase.Name,
/*Body*/
str_Message + aqTestCase.CurrentTestCase.Name + "' failed " +
" Running on: " + Sys.HostName);
//" Running on: " + Sys.HostName +
//"\n\rThis is a TEST error sent to " + Project.Variables.strEmail_Rcpt);
}
}
function SendEmail(str_RcptAddr, str_Server, str_SenderName, str_SenderAddr, str_Subj, str_Body, str_Files = null)
{
var b_Result = false;
if (str_Files == null){
if (SendMail(str_RcptAddr, str_Server, str_SenderName, str_SenderAddr, str_Subj, str_Body)){
Log["Message"]("Mail was sent");
var b_Result = true;
}
else{
Log["Warning"]("Mail was not sent");
var b_Result = false;
}
}
else{
if (SendMail(str_RcptAddr, str_Server, str_SenderName, str_SenderAddr, str_Subj, str_Body, str_Files)){
Log["Message"]("Mail was sent");
var b_Result = true;
}
else{
Log["Warning"]("Mail was not sent");
var b_Result = false;
}
}
}