title: Sending thunderbird email with attachment using visual basic from windows
body: <p>I'm trying to send email from a visual basic script using Visual basic WITHOUT any user action.  The idea came for the first reference below.</p>
  
  <p><a href="http://forums.mozillazine.org/viewtopic.php?f=39&amp;t=540783" rel="nofollow">http://forums.mozillazine.org/viewtopic.php?f=39&amp;t=540783</a> </p>
  
  <p><a href="http://forums.mozillazine.org/viewtopic.php?t=203591" rel="nofollow">http://forums.mozillazine.org/viewtopic.php?t=203591</a> </p>
  
  <p><a href="https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#-options" rel="nofollow">https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#-options</a></p>
  
  <p>The script does work BUT I have been unable to figure out how to include attachments. I know little about VB but in the first reference the mixture of " and chr(34) (" I assume) seems very weird. Also the discrepancy between "mailto" and "to" between the first and third reference is troubling.</p>
  
  <p>Here's what I have tried.</p>
  
  <pre><code>dim s
  Set s = CreateObject("WScript.Shell")
  s.run """thunderbird.exe""" &amp; " -compose mailto:mdorl@wisc.edu? &amp;subject=""send mail 3""&amp;body=""nice body text""&amp;attachment='file:///c:/Documents and Settings/Mike/My Documents/sendmail/vb/msg.txt'" 
  WScript.Sleep 1000
  s.SendKeys "^{ENTER}"
  WScript.Sleep 1000 
  </code></pre>
  
  <p>This composes and sends an email without user action BUT without the attachment. I have tried both single and double quotes around the file name.</p>
  
  <p>If I change the file name to a non-existent file, an email is send without attachment BUT user action is required to actually send the message.</p>