Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://www.blat.net/" rel="noreferrer">Blat</a> lets you send e-mails directly from batch files:</p> <pre><code>blat.exe - -f from@example.com -to to@gmail.com -s Subject -body "Text body" ^ -server smtp.example.com:25 -u username -pw password </code></pre> <p>But it seems that Blat doesn't support SSL, so to make it work with the Gmail you need an additional tool called <a href="http://www.stunnel.org/" rel="noreferrer">Stunnel</a> (see <a href="http://yqbjohn.blogspot.com/2007/03/experiment-send-mail-with-dos-command.html" rel="noreferrer">here</a> and <a href="http://www.autohotkey.com/forum/topic4486.html" rel="noreferrer">here</a>).</p> <p>Anyway, you should be able to send an e-mail via GMail from VBScript using the <a href="http://support.microsoft.com/kb/171440" rel="noreferrer">Collaboration Data Objects (CDO)</a> COM API:</p> <pre><code>Const schema = "http://schemas.microsoft.com/cdo/configuration/" Const cdoBasic = 1 Const cdoSendUsingPort = 2 Dim oMsg, oConf ' E-mail properties Set oMsg = CreateObject("CDO.Message") oMsg.From = "from@gmail.com" ' or "Sender Name &lt;from@gmail.com&gt;" oMsg.To = "to@gmail.com" ' or "Recipient Name &lt;to@gmail.com&gt;" oMsg.Subject = "Subject" oMsg.TextBody = "Text body" ' GMail SMTP server configuration and authentication info Set oConf = oMsg.Configuration oConf.Fields(schema &amp; "smtpserver") = "smtp.gmail.com" oConf.Fields(schema &amp; "smtpserverport") = 465 oConf.Fields(schema &amp; "sendusing") = cdoSendUsingPort oConf.Fields(schema &amp; "smtpauthenticate") = cdoBasic oConf.Fields(schema &amp; "smtpusessl") = True oConf.Fields(schema &amp; "sendusername") = "from@gmail.com" oConf.Fields(schema &amp; "sendpassword") = "sender_password" oConf.Fields.Update oMsg.Send </code></pre> <p><strong><em>Edit:</strong> Added the lacking <code>sendusing</code> parameter so it should work fine now.</em></p> <p>See <a href="http://www.paulsadowski.com/WSH/cdo.htm" rel="noreferrer">here</a> for more CDO examples.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload