Forum Discussion

mesg2anil's avatar
mesg2anil
Regular Contributor
13 years ago

SendMail not sending the email

Hi,



I'm trying the below code to send the email through SendMail, it is not working. Our email is linked with gmail.com so the host will be smtp.gmail.com. I still cannot send an email. What could be the issue?



Below code is throwing "Mail was not sent" message :(


Sub mail



If SendMail("anil@mail.com", "smtp.gmail.com", "Anil Yadrami", "sunil@mail.com", "Notification", "Hello Anil, Your application is nice.") Then


Log.Message "Mail was sent"


Else


Log.Warning "Mail was not sent"


End If

End Sub



 

7 Replies

  • mesg2anil's avatar
    mesg2anil
    Regular Contributor
    Hi Allen,



    Thanks a lot for the link!!

    The link which you suggested is for gmail account, in case if I want to send the an email using work email id, do I still need to follow same procedure?
  • Hi Allen



    The sendmail method doesn't work. I am getting an error msg as "Socket Error # 10060"



    Can u please help me in resolving this issue.



    With Regards

    Nikhil
  • vex's avatar
    vex
    Contributor
    Probably blocked.  You can try to telnet into it.  If you see something along the lines of:



    220 mail2.mailprovider.net ESMTP




    Then it's not blocked.  If you can't reach it, then you're behind a firewall that is blocking that smtp server.

  • Hello Nikhil,



    This error is not TestComplete-related. Check the settings you specified for e-mail (the parameters of the SendMail method) with your system administrator.