Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Sending emails with attachments


  • Please log in to reply
7 replies to this topic
GoVVon
  • Members
  • 60 posts
  • Last active: Oct 13 2013 06:07 PM
  • Joined: 17 Dec 2012

Hello,

 

I would like to ask what is the best method for sending emails with attachments via AutoHotkey (News)

 

Thanks for the answer :-)



garry
  • Spam Officer
  • 3219 posts
  • Last active: Sep 20 2018 02:47 PM
  • Joined: 19 Apr 2005

example with thunderbird

filex   =c:\test.jpg
ifnotexist,%filex%
  {
  msgbox,%filex% not exists .
  exitapp
  }
tox     =garryATbluemail.net   ; adress 
subject =Test55
body    =FollowedLine1`%0AFollowedLine2
dates   =%a_now%
      TO=to='%TOX%'
      PR=%A_ProgramFiles%\Mozilla Thunderbird\thunderbird.exe
      SB=subject=%subject%
      AT=attachment='%FILEX%'
      BD=body=Hallo Garry`%0A`%0AHow are you ?`%0A`%0A%body%`%0A`%0AGreetings`%2C`%0A garry`%0A`%0A`%0A%dates%
      ALL=%TO%,%SB%,%AT%,%BD%
      run,%PR% -compose "%ALL%"
exitapp



Seidenweber
  • Moderators
  • 638 posts
  • Last active: Sep 06 2015 01:51 PM
  • Joined: 10 May 2011

..after I read lots of [censored] about how to do this with ThunderBird - it's the FIRST working example, I've seen.
 
Thanks!


All questions & answers are related to AHK 1.1.19.03 x64 Unicode

 


GoVVon
  • Members
  • 60 posts
  • Last active: Oct 13 2013 06:07 PM
  • Joined: 17 Dec 2012

ank you but I wrote that I want to use mainly AutoHotkey (and some .Dll or .Exe that are made ​​for AutoHotkey)

I do not use a mail client that must be installed in advance...

 

 

Any other ideas thank you?



Coco
  • Members
  • 697 posts
  • Last active: Oct 31 2015 07:26 PM
  • Joined: 27 Jul 2012

Try this: http://www.autohotke...delivery-ahk-l/



GoVVon
  • Members
  • 60 posts
  • Last active: Oct 13 2013 06:07 PM
  • Joined: 17 Dec 2012

I also found that someone uses...

 

mailsend: www.code.google.com/p/mailsend/

blat: www.blat.net/

 

 

What is your experience or what would you recommend?



garry
  • Spam Officer
  • 3219 posts
  • Last active: Sep 20 2018 02:47 PM
  • Joined: 19 Apr 2005

example with blat.exe

;========================================================================
;-- fill out first   for me only SENDTO was needed -----------------------
/*
;own_INPOPSERVER  =pop.bluemail.net
;own_SMTP         =mail.bluemail.net
;own_emailadress  [email protected]
;own_password1    =123456ABCD
;SENDTO           [email protected]            ;<<<<   own adress for test
*/


;SENDTO           [email protected]           ;<<<<   own adress for test
F1:="C:\test1.jpg,C:\Test2.jpg"                     ;- attached files check fullpath ( use a GUI with drag&drop for this )

;--------------------------------------------


FileLog=_blat.log

binfil =_FileBinary.txt
txtfil =_FileText.txt
inlfil =_FileInline.txt


ifexist,%FileLog%
  filedelete,%Filelog%
ifexist,%inlfil%
  filedelete,%inlfil%
ifexist,%binfil%
  filedelete,%binfil%

ifnotexist,%inlfil%
  Fileappend,Hallo garry how are you ?  (message from _FileInline.txt) `r`n,%inlfil%
ifnotexist,%txtfil%
  Fileappend,,%txtfil%
ifnotexist,%binfil%
  Fileappend,%f1%`r`n,%binfil%              ;-- attach

Fileappend,`r`n---------------------`r`nSent %A_NOW%`r`n,%inlfil%

SplashImage,SEND,m2,Wait....`nBlat-mailer is now sending to %SendTo%
Runwait,%comspec% /c Blat - -body "Hallo garry" -subject "Greetings" -to %SENDTO% -attachi %inlfil% -atf %txtfil% -af %binfil% -log %FileLog% -timestamp
SplashImage, Off
run,%filelog%
exitapp
;======================================================




/*
;-- content from txtfil  (a file contents path from text )
C:\test22.txt,C:\test.txt,C:\netstat.txt,C:\format.txt,
;-- content from binfil  (file contents path from binary data)
C:\test.jpg,
;-- content from inlfil   (embedded text)
Hallo garry how are you ?


-attach <file>  : attach binary file(s) to message (filenames comma separated)
-attacht <file> : attach text file(s) to message (filenames comma separated)
-attachi <file> : attach text file(s) as INLINE (filenames comma separated)
-embed <file>   : embed file(s) in HTML.  Object tag in HTML must specify
                  content-id using cid: tag.  eg: <img src="cid:image.jpg">
-af <file>      : file containing list of binary file(s) to attach (comma
                  separated)
-atf <file>     : file containing list of text file(s) to attach (comma
                  separated)
-aef <file>     : file containing list of embed file(s) to attach (comma
                  separated)
*/
;=============================================================================





Coco
  • Members
  • 697 posts
  • Last active: Oct 31 2015 07:26 PM
  • Joined: 27 Jul 2012

I haven't used blat.exe, only CDO COM. The latter works well, tested it with normal messages, with cc and bcc, and also with attachments. No dependencies except for CDO.dll/cdosys.dll (not really sure here, probably the latter), which is usually shipped with Windows