Clicky

20160425

'Mail to me' for Outlook clients


The next VBscript sends a file from the command line or dragged to the shortcut of this script to your Outlook email account:

if wscript.arguments.count<>1 then wscript.quit

AttachmentName=wscript.arguments.item(0)

set fso=CreateObject("scripting.filesystemobject")
if not fso.FileExists(AttachmentName) then wscript.quit

Set objOutlook = CreateObject("Outlook.Application")
Set objMail = objOutlook.CreateItem(0)
objMail.To = "{here the email address to send to@email.nn}"
objMail.Subject = "Received attachement"
objMail.Body = "Attached file: """ & fso.GetFileName(AttachmentName) & """"
objMail.Attachments.Add(AttachmentName)
objMail.Send  
if Err=0 then MsgBox "Successfully sent: "& vbCrLF & "- """ &
fso.GetFileName(AttachmentName) & """"

See also this post.

No comments :

Post a Comment

Real Time Web Analytics