Forum Discussion

amit72avcg's avatar
amit72avcg
Occasional Contributor
14 years ago

How to send e-mails?

Hi,

I want to know whether I'll be able to send emails from scipts if MS Office is not installed at my system?

I have gone through the help section and tried BuiltIn.SendMail functionality but am unable to send any mail.

What are the requirements or settings I have to chnage on my system in order to send the mails?



Thanks
  • amit72avcg's avatar
    amit72avcg
    Occasional Contributor
    Hi,

    This is the code I am using:



    function SendEmail()

    {

        if (BuiltIn["SendMAPIMail"]("Amit", "amit10.t@tcs.com", "Notification", "Hello Amit, This is a mail from Test Complete"))

            Log["Message"]("Mail was sent");

        else

            Log["Warning"]("Mail was not sent");

    }



    I am getting a warning message "Mail was not sent".

    My working area provides internet access only to a few limited sites, relating to the organisation.

    Is this the reason for the failure in sending?
    • Harouna1988_'s avatar
      Harouna1988_
      Member

      Hello

       

      how did you go about collecting the test report, how did you export

  • Hi,


    There are no special requirements for your system to send e-mails from TestComplete. Just make sure that you specify the BuiltIn.SendMail method's parameters correctly. If you still cannot send an e-mail using the BuiltIn.SendMail method, check whether TestComplete posts any error message to the test log during the test run.


    Besides the SendMail method, you can also use Collaboration Data Objects (CDO) to send e-mails from your scripts. For more information on this, see Sending E-Mail From Scripts in the online documentation.

  • amit72avcg's avatar
    amit72avcg
    Occasional Contributor
    Hi,

    I have tried BuiltIn.SendMAPIMail() function and it is giving an exception. I have also tried to do the same using CDO but facing the same problem.

    My Test Complete version is 6.0. Does it support BuiltIn.SendMail() functionality?



    Thanks
  • Hi,


    Unfortunately, TestComplete version 6 does not support the BuiltIn.SendMail() functionality. To use this method, you need to update to the latest version of  TestComplete (v. 8.6).


    To help us investigate your problem with the BuiltIn.SendMAPIMail() function, please send us the code you use and the text of the exception.

  • Hi,


    Your code is correct. So, the problem is not in it.


    The fact is that SendMAPIMail interacts with the mail client installed on your computer. Your mail client may incorrectly implement support for the SendMAPIMail functionality. What mail client are you using?

  • amit72avcg's avatar
    amit72avcg
    Occasional Contributor


    Hi,



    I am using Lotus notes. Is there any solution for my problem?



    Thanks

  • Hi Amit,





    We haven't tried using TestComplete with Lotus Notes. Also, I'm not very familiar with this product and a quick search on the web does not return any useful information on e-mail clients for Lotus Notes. Could you please give me some more detailed information on the specific name and version of the e-mail client application you use?





    BTW, if the non-visual methods do not work properly for you, you can try simply recording the needed GUI actions and sending mails via playing back the corresponding test. This can give you a solution much faster, because if we start investigating the Lotus Notes problem, this can take much time.