Forum Discussion

mengbinhao's avatar
mengbinhao
Contributor
3 years ago
Solved

SendMail not Woring

Hi There,

  I use buildin SendMail to send email after all test items finished, below is my very simple code example: (toAddress / fromHost / fromAddress are right and valid)

  

 

const toAddress = "guest2@ourunited.com"
const fromHost = "smtp.ourunited.com"
const fromName = "guest1"
const fromAddress = "guest1@ourunited.com"
const subject = "test sending email"
const body = "test email body"
  
if (SendMail(toAddress, fromHost, fromName, fromAddress, subject, body)) {
  Log.Message("Successfully!")
} else {
  Log.Message("Fail!")
}

 

 It threw error after test items were executed, report as below:

 

 Anything am I incorrect? Please provide some useful help to me, thanks!

  • Use fake fromAddress to resolve this issue