Forum Discussion
You'll need compose an HTML email for the body and reference the attached image.
I.E. <img src="attachedimage.png">
- shankar_r8 years agoCommunity Hero
You can have custom function to do this stuff as like below,
function sendmail()
{
var theApp = new Sys.OleObject("Outlook.Application") var theMailItem = theApp.CreateItem(0) // value 0 = MailItem var msg ="<center><img src=" + chr(34) + "<image path>"+ chr(34) + " alt=" + chr(34) + "<Tooltip text>" + chr(34) + "style=" + chr(34) + "width:180px;height:120px;" + chr(34) + "></center>"; theMailItem.to = "<to address>" theMailItem.Subject = ("<SUB line>"); theMailItem.BodyFormat = 2; theMailItem.HTMLBody = (msg); theMailItem.Attachments.Add("<file path>"); theMailItem.display(); theMailItem.Send();
theApp =null;
}You can make alignments, tool tip, position and etc,. from below code
var msg ="<center><img src=" + chr(34) + "<image path>"+ chr(34) + " alt=" + chr(34) + "<Tooltip text>" + chr(34) + "style=" + chr(34) + "width:180px;height:120px;" + chr(34) + "></center>";
- AlexKaras8 years agoChampion Level 3
shankar_r, Ryan_Moran :
> image would be displayed in message body in the email client.As the image will be displayed on the remote client, I think that all images must be encoded and included in the message body so that they are accessible on the remote client.
Not sure about implementation complexity at the moment.
- tristaanogre8 years agoEsteemed Contributor
An option:
1) Write the image to your test log using Log.Picture2) Export your test log at the end of your test to a local file
3) Attach the exported log to your e-mail
That would send the appropriate picture as well as have the bonus of including the rest of the test log.
Also, if you don't HAVE to have the picture embedded in the e-mail, this option is available to you. Additionally, you could simply attach the image to the e-mail and not worry about it being embedded.
Another option:
shankar_r has a library of code that writes test log information out to HTML. Perhaps you could utilize something like that and write the output to an HTML file in a shared drive location. Then, in your e-mail, simply send a link to that location in the body of the e-mail and the end user can click the link to view the results.
All this is, of course, contingent on whether or not the image MUST be embedded in the e-mail body. If it is, then you're dealing with a complicated issue of embedding an image so that it is viewable on a non-local machine.
Related Content
- 3 years agojoaosaidel
- 2 years agomattb
Recent Discussions
- 3 hours agoSubhraDas
- 22 hours agotramuntana