Sign in to follow this  
Followers 0
rednosewoman

including picture into body of an email

20 posts in this topic

Hey guys,

first of all i have to metion that my english isn't the best, but i hope you will unsterstand my problem.

I want to program a script which is able to open my standard mail client, filling Mailtoand so on.. 

My problem is, that i have to include an attachment (Picture from my desktop as emailbody)

How can i manage it?

 

_inetmail ("user@server.com","Pic of my desktop","C:usersuserdesktoppicture"") doesn't work at all... :(

 

Best regards

RNW

 

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Welcome to AutoIt and the forum!

What is your mail client? Outlook?

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Just use the HTML-tag "<img>" in your email. Every (modern) mailclient can display HTML.

Share this post


Link to post
Share on other sites

Okay, but who do i include it into my code?

Please help, thx!

Share this post


Link to post
Share on other sites

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

okay, thanks! but could you edit my code to give me an example?

Share this post


Link to post
Share on other sites

We do not spoon-feed users here ;)

First try it yourself. If you run into problems, ask and we will try to help.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Hey again!

I tried, but i did not get it yet.

_inetmail ("xxx@yyy","xxxxx",""This is a test"<img src="Desktopscreenshot.jpg">"Test")

What have i done wrong?

edit: Autoit says syntax error

Edited by rednosewoman

Share this post


Link to post
Share on other sites

You really need to learn HTML ;)

"<HTML><Body>This is a test <img src="Desktopscreenshot.jpg"> Test</body></html>"


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Are there any includes which i have to do?

Because it says syntax error .

Yeah i just started with autoit, didnt know i need hmtl for this :P

Edited by rednosewoman

Share this post


Link to post
Share on other sites

Check the help file for _inetmail and you will see which include is needed ;)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#include <Inet.au3>

i had this already included. how is it possible that he still says syntax error, when i use the function?

i included the function you gave me in the _inet mail :S

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

#include <Inet.au3>

;===========================

$sMailTo = "xxxx@xxxx.com"

$sMailSubject = "Hi"

$sMailBody = "Hello i want to send that email to xxxx@xxxx.com <HTML code>"

;===========================

_INetMail ( $sMailTo, $sMailSubject, $sMailBody )

Maybe that can help you to understand the syntax becose you 're using 4 x double quote and with the help syntax you have to use 3 quote ?

_inetmail ("*@*.com","Hi","Hello... <HTML code> ..")
Edited by caramen

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

It still says syntax error.

:(

I did it like water said!

Edited by rednosewoman

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

"<HTML><Body>This is a test <img src="Desktopscreenshot.jpg"> Test</body></html>"

This syntax cannot be used by the function you are using .

becose you got 2x 2 quote

put it in a variable

$sMailBody = '<HTML><Body>This is a test <img src="Desktop\screenshot.jpg"> Test</body></html> '

Edit : Water's tips





			
				


	Edited  by caramen
	
	

			
		

Share this post


Link to post
Share on other sites

My bad. Should be single quotes around the whole string:

'<HTML><Body>This is a test <img src="Desktop\screenshot.jpg"> Test</body></html>'

or

$sMailBody = '<HTML><Body>This is a test <img src="Desktop\screenshot.jpg"> Test</body></html>'

if you want to try what Adventurer suggested.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

Desktopscreenshot.jpg

 

I don't think it will works because it is a relative path, you should use instead:

C:\users\user\desktop\screenshot.jpg
Edited by j0kky

Share this post


Link to post
Share on other sites

Or even better:

@DesktopDir & "\screenshot.jpg"

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

http://sourceforge.net/projects/blat/

Might be more suitable for this kind of task than Outlook. Takes a bit of figuring-out the right commandline parameters but once it's set up it's independent of any other email program, and can easily be scripted. We use this to send backup reports.  If you want to send a picture such that it will display IN the email itself, use the embed option.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0