How to insert an image into message body in TestComplete script with a help of SendEmail function?
Hello! I'm creating an automated test script for a desktop application. After test finished, an image with test results is created.
After an image was created, it is put by means of TestComplete script into a folder on a local PC(e.g. "C://image.png"). Then the script sends an email with the help of TestComplete function SendEmail(mFrom, mTo, mSubject, mBody, mAttach).
I need to include an image into a message body of SendEmail function (mBody) in such a way that this image would be displayed in message body in the email client. If I include a local path of to an image("<img src=C://image.png>"), then mail client sure doesn't understand where is an image situated and doesn't display an image in my email client.
That's how my SendEmail function is called in this case:
SendEmail("from@mail.com", "to@mail.com", "Subject", '<img src="C:/image.png" height="42" width="42">', "attachments");
Then I tried to include into message body an image from Internet(something like "<img src=http://www.site.com/image.png>"). In such case image can be displayed in message body in the email client.
That's how my SendEmail function is called in this case:
SendEmail("from@mail.com", "to@mail.com", "Subject", '<img src="http://www.site.com/image.png" height="42" width="42">', "attachments");
But in such a case, by means of my test script an image should be put from my local PC into some web site or hosting. Is it possible to put an image to a web site by means of TestComplete script?
Maybe there are more reasonable ways, or if there is the best way of how to include an image to a message body of SendEmail function - like converting an image into base64 etc. Maybe I chose an incorrect way of including an image into message body.
If you can just advice me a direction in which I have to move solving this task - I will be very pleased.
If my explanation is not clear - please ask me, I'll try to explain it better and give some pictures or more code. Thanks for any help in advance.