title: How to send email using vbscript and remote smtp server. I am connected through a proxy
body: <p>I tried to write a vbscript to mail using gmail smtp but it is not working because <strong>I am connected to internet through proxy.</strong>
  Below is my code.</p>
  
  <hr>
  
  <pre><code>Set objMessage = CreateObject("CDO.Message") 
  objMessage.Subject = "Example CDO Message" 
  objMessage.From = "myemail@gmail.com" 
  objMessage.To = "tomail@gmail.com" 
  objMessage.TextBody = "This is some sample message text."
  
  '==This section provides the configuration information for the remote SMTP server.
  '==Normally you will only change the server name or IP.
  objMessage.Configuration.Fields.Item _
  ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
  
  'Name or IP of Remote SMTP Server
  objMessage.Configuration.Fields.Item _
  ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
  
  'Server port (typically 25)
  objMessage.Configuration.Fields.Item _
  ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
  
  objMessage.Configuration.Fields.Item _
  ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
  
  objMessage.Configuration.Fields.Item _
  ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true
  
  objMessage.Configuration.Fields.Item _
  ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "MyUserName"
  
  objMessage.Configuration.Fields.Item _
  ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "MyPassword"
  
  
  objMessage.Configuration.Fields.Update
  
  '==End remote SMTP server configuration section==
  
  objMessage.Send
  </code></pre>
  
  <hr>
  
  <p>when i am running this code it gives me error "The transport failed to connect to the server"
  Can anyone provide me an example. I am connected to internet through proxy.</p>
  
  <p><strong>Thanks
  Waqar</strong></p>