Ask a Question

Problem with sending an email using the aqUtils.Email.Send() method.

balakumarm
New Contributor

Problem with sending an email using the aqUtils.Email.Send() method.

Hi, I attempted to send an email using aqUtils.Email.Send(). Below I have mentioned that the code

 

function OnLogError(Sender, LogParams)
{
 // Check if the error is related to a test case failure
 if ( LogParams.MessageText = "An unexpected window has appeared.")
 {
   // Prepare email parameters
   var recipient = "recipient@example.com";
   var subject = "Test Case Failed!";
   var body = "The following test case failed: " + LogParams.LogMessage;

   // Send the email using Office 365 SMTP server settings
   aqUtils.Email.Send("smtp.office365.com", 587, "your_office365_username", "your_office365_password", recipient, subject, body);
 }
}

I get an error as "cannot read property 'send' of undefined."

balakumarm_0-1692809118043.png

 

Can somebody assist me in resolving the problem I'm having?

2 REPLIES 2
rraghvani
Champion Level 3

See aqUtils Object Methods, there's no method called Email

rraghvani
Champion Level 3

I suggest you read through Sending Email From Scripts, and try the example - your SMTP server may be configured not to allow anonymous or unauthenticated emails to be sent.

 

See previous post, 

https://community.smartbear.com/t5/TestComplete-Questions/Sending-email-by-scirpt-failed-because-soc...

https://community.smartbear.com/t5/TestComplete-Questions/Send-log-reports-to-co-workers/m-p/251949

cancel
Showing results for 
Search instead for 
Did you mean: