Send emails from your gmail account with UI (VBscript)

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury

Post Reply
User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Send emails from your gmail account with UI (VBscript)

Post by Rain » Fri Mar 01, 2013 9:57 pm

This is an improvement from my original 'A script to send email from your gmail account (VBscript)' example located here. This example has a user Interface (UI). See remarks in the script and inside the dialog by click the help icons. This script can be configured for other SMTP Servers. I use Gmail in this example because it's my preferred email service.
Image

Code: Select all


GoSub>LoadVBscrip

Dialog>Dialog1
object Dialog1: TForm
  Left = 247
  Top = 96
  HelpContext = 5000
  BorderIcons = []
  Caption = 'Gmail Buddy'
  ClientHeight = 455
  ClientWidth = 560
  Color = clWhite
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  Position = poScreenCenter
  ShowHint = True
  OnTaskBar = True
  PixelsPerInch = 96
  TextHeight = 13
  object Panel1: TPanel
    Left = 209
    Top = 0
    Width = 351
    Height = 455
    Align = alClient
    BevelOuter = bvNone
    BevelWidth = 2
    BorderStyle = bsSizeable
    TabOrder = 0
    ExplicitHeight = 409
    object Label3: TLabel
      Left = 0
      Top = 34
      Width = 351
      Height = 13
      Align = alTop
      Caption = 'Subject'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = [fsBold]
      ParentFont = False
      ExplicitWidth = 44
    end
    object Label4: TLabel
      Left = 0
      Top = 0
      Width = 351
      Height = 13
      Align = alTop
      Caption = 'To'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = [fsBold]
      ParentFont = False
      ExplicitWidth = 16
    end
    object Label5: TLabel
      Left = 0
      Top = 68
      Width = 351
      Height = 13
      Align = alTop
      Caption = 'Message Body'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = [fsBold]
      ParentFont = False
      ExplicitWidth = 83
    end
    object MSImage1: tMSImage
      Left = 20
      Top = 2
      Width = 10
      Height = 10
      Cursor = crHelp
      Picture.Data = {
        07544269746D6170AE040000424DAE0400000000000036040000280000000A00
        00000A000000010008000000000078000000C40E0000C40E0000000100000000
        000000000000000080000080000000808000800000008000800080800000C0C0
        C000C0DCC000F0CAA6000020400000206000002080000020A0000020C0000020
        E00000400000004020000040400000406000004080000040A0000040C0000040
        E00000600000006020000060400000606000006080000060A0000060C0000060
        E00000800000008020000080400000806000008080000080A0000080C0000080
        E00000A0000000A0200000A0400000A0600000A0800000A0A00000A0C00000A0
        E00000C0000000C0200000C0400000C0600000C0800000C0A00000C0C00000C0
        E00000E0000000E0200000E0400000E0600000E0800000E0A00000E0C00000E0
        E00040000000400020004000400040006000400080004000A0004000C0004000
        E00040200000402020004020400040206000402080004020A0004020C0004020
        E00040400000404020004040400040406000404080004040A0004040C0004040
        E00040600000406020004060400040606000406080004060A0004060C0004060
        E00040800000408020004080400040806000408080004080A0004080C0004080
        E00040A0000040A0200040A0400040A0600040A0800040A0A00040A0C00040A0
        E00040C0000040C0200040C0400040C0600040C0800040C0A00040C0C00040C0
        E00040E0000040E0200040E0400040E0600040E0800040E0A00040E0C00040E0
        E00080000000800020008000400080006000800080008000A0008000C0008000
        E00080200000802020008020400080206000802080008020A0008020C0008020
        E00080400000804020008040400080406000804080008040A0008040C0008040
        E00080600000806020008060400080606000806080008060A0008060C0008060
        E00080800000808020008080400080806000808080008080A0008080C0008080
        E00080A0000080A0200080A0400080A0600080A0800080A0A00080A0C00080A0
        E00080C0000080C0200080C0400080C0600080C0800080C0A00080C0C00080C0
        E00080E0000080E0200080E0400080E0600080E0800080E0A00080E0C00080E0
        E000C0000000C0002000C0004000C0006000C0008000C000A000C000C000C000
        E000C0200000C0202000C0204000C0206000C0208000C020A000C020C000C020
        E000C0400000C0402000C0404000C0406000C0408000C040A000C040C000C040
        E000C0600000C0602000C0604000C0606000C0608000C060A000C060C000C060
        E000C0800000C0802000C0804000C0806000C0808000C080A000C080C000C080
        E000C0A00000C0A02000C0A04000C0A06000C0A08000C0A0A000C0A0C000C0A0
        E000C0C00000C0C02000C0C04000C0C06000C0C08000C0C0A000F0FBFF00A4A0
        A000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF
        FF00FFFFFFFFFFFFFFFFFFFF0000F6F6EDD2C0C8D209F6F60000F6D2C0C0FFFF
        C0C0E4F60000DBC0C0C0C0C0C0C0C9ED0000C0C0C0C0FFFFC0C0C0D20000C0C0
        C0C0C0FFFFC0C0D20000C0C8C0FFC0C0FFC0C0D20000DBC9C0FFFFFFFFC0C9ED
        0000F6D2C9C0C0C0C0C0E4F60000F6F6EDD2C0C9DB09F6F60000}
    end
    object ToInput: TEdit
      Left = 0
      Top = 13
      Width = 351
      Height = 21
      Align = alTop
      TabOrder = 0
    end
    object MessageBodyInput: tMSMemo
      Left = 0
      Top = 81
      Width = 351
      Height = 334
      Align = alClient
      BevelInner = bvLowered
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -16
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      Lines.Strings = (
        'Test')
      ParentFont = False
      ScrollBars = ssVertical
      TabOrder = 1
      Text = 'Test'
      ExplicitHeight = 360
    end
    object SubjectInput: TEdit
      Left = 0
      Top = 47
      Width = 351
      Height = 21
      Align = alTop
      TabOrder = 2
      Text = '(no subject)'
    end
    object Panel3: TPanel
      Left = 0
      Top = 415
      Width = 351
      Height = 40
      Align = alBottom
      Alignment = taLeftJustify
      BevelOuter = bvNone
      Caption = 'Attach File'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = [fsBold]
      ParentFont = False
      TabOrder = 3
      VerticalAlignment = taAlignTop
      object AttachmentInput: TEdit
        Left = 0
        Top = 16
        Width = 257
        Height = 21
        Enabled = False
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clBlack
        Font.Height = -11
        Font.Name = 'MS Sans Serif'
        Font.Style = []
        ParentFont = False
        TabOrder = 0
      end
      object MSButton2: tMSButton
        Left = 258
        Top = 16
        Width = 75
        Height = 21
        Caption = 'Browse'
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clBlack
        Font.Height = -11
        Font.Name = 'MS Sans Serif'
        Font.Style = []
        Glyph.Data = {
          F6000000424DF600000000000000760000002800000010000000100000000100
          0400000000008000000000000000000000001000000010000000000000000000
          80000080000000808000800000008000800080800000C0C0C000808080000000
          FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00777777777777
          77777777777777777777000000000007777700333333333077770B0333333333
          07770FB03333333330770BFB0333333333070FBFB000000000000BFBFBFBFB07
          77770FBFBFBFBF0777770BFB0000000777777000777777770007777777777777
          7007777777770777070777777777700077777777777777777777}
        ParentFont = False
        TabOrder = 1
        DoBrowse = False
        BrowseStyle = fbOpen
      end
    end
  end
  object Panel2: TPanel
    Left = 0
    Top = 0
    Width = 209
    Height = 455
    Align = alLeft
    BevelOuter = bvNone
    TabOrder = 1
    object Label1: TLabel
      Left = 8
      Top = 72
      Width = 164
      Height = 13
      Caption = 'Username to send email from'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clBlack
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = [fsBold]
      ParentFont = False
    end
    object Label2: TLabel
      Left = 8
      Top = 112
      Width = 55
      Height = 13
      Caption = 'Password'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clBlack
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = [fsBold]
      ParentFont = False
    end
    object Label6: TLabel
      Left = 8
      Top = 48
      Width = 99
      Height = 13
      Caption = 'Login Information'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = [fsBold]
      ParentFont = False
    end
    object MSImage2: tMSImage
      Left = 175
      Top = 75
      Width = 10
      Height = 10
      Cursor = crHelp
      Picture.Data = {
        07544269746D6170AE040000424DAE0400000000000036040000280000000A00
        00000A000000010008000000000078000000C40E0000C40E0000000100000000
        000000000000000080000080000000808000800000008000800080800000C0C0
        C000C0DCC000F0CAA6000020400000206000002080000020A0000020C0000020
        E00000400000004020000040400000406000004080000040A0000040C0000040
        E00000600000006020000060400000606000006080000060A0000060C0000060
        E00000800000008020000080400000806000008080000080A0000080C0000080
        E00000A0000000A0200000A0400000A0600000A0800000A0A00000A0C00000A0
        E00000C0000000C0200000C0400000C0600000C0800000C0A00000C0C00000C0
        E00000E0000000E0200000E0400000E0600000E0800000E0A00000E0C00000E0
        E00040000000400020004000400040006000400080004000A0004000C0004000
        E00040200000402020004020400040206000402080004020A0004020C0004020
        E00040400000404020004040400040406000404080004040A0004040C0004040
        E00040600000406020004060400040606000406080004060A0004060C0004060
        E00040800000408020004080400040806000408080004080A0004080C0004080
        E00040A0000040A0200040A0400040A0600040A0800040A0A00040A0C00040A0
        E00040C0000040C0200040C0400040C0600040C0800040C0A00040C0C00040C0
        E00040E0000040E0200040E0400040E0600040E0800040E0A00040E0C00040E0
        E00080000000800020008000400080006000800080008000A0008000C0008000
        E00080200000802020008020400080206000802080008020A0008020C0008020
        E00080400000804020008040400080406000804080008040A0008040C0008040
        E00080600000806020008060400080606000806080008060A0008060C0008060
        E00080800000808020008080400080806000808080008080A0008080C0008080
        E00080A0000080A0200080A0400080A0600080A0800080A0A00080A0C00080A0
        E00080C0000080C0200080C0400080C0600080C0800080C0A00080C0C00080C0
        E00080E0000080E0200080E0400080E0600080E0800080E0A00080E0C00080E0
        E000C0000000C0002000C0004000C0006000C0008000C000A000C000C000C000
        E000C0200000C0202000C0204000C0206000C0208000C020A000C020C000C020
        E000C0400000C0402000C0404000C0406000C0408000C040A000C040C000C040
        E000C0600000C0602000C0604000C0606000C0608000C060A000C060C000C060
        E000C0800000C0802000C0804000C0806000C0808000C080A000C080C000C080
        E000C0A00000C0A02000C0A04000C0A06000C0A08000C0A0A000C0A0C000C0A0
        E000C0C00000C0C02000C0C04000C0C06000C0C08000C0C0A000F0FBFF00A4A0
        A000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF
        FF00FFFFFFFFFFFFFFFFFFFF0000F6F6EDD2C0C8D209F6F60000F6D2C0C0FFFF
        C0C0E4F60000DBC0C0C0C0C0C0C0C9ED0000C0C0C0C0FFFFC0C0C0D20000C0C0
        C0C0C0FFFFC0C0D20000C0C8C0FFC0C0FFC0C0D20000DBC9C0FFFFFFFFC0C9ED
        0000F6D2C9C0C0C0C0C0E4F60000F6F6EDD2C0C9DB09F6F60000}
    end
    object MSImage3: tMSImage
      Left = 66
      Top = 115
      Width = 10
      Height = 10
      Cursor = crHelp
      Picture.Data = {
        07544269746D6170AE040000424DAE0400000000000036040000280000000A00
        00000A000000010008000000000078000000C40E0000C40E0000000100000000
        000000000000000080000080000000808000800000008000800080800000C0C0
        C000C0DCC000F0CAA6000020400000206000002080000020A0000020C0000020
        E00000400000004020000040400000406000004080000040A0000040C0000040
        E00000600000006020000060400000606000006080000060A0000060C0000060
        E00000800000008020000080400000806000008080000080A0000080C0000080
        E00000A0000000A0200000A0400000A0600000A0800000A0A00000A0C00000A0
        E00000C0000000C0200000C0400000C0600000C0800000C0A00000C0C00000C0
        E00000E0000000E0200000E0400000E0600000E0800000E0A00000E0C00000E0
        E00040000000400020004000400040006000400080004000A0004000C0004000
        E00040200000402020004020400040206000402080004020A0004020C0004020
        E00040400000404020004040400040406000404080004040A0004040C0004040
        E00040600000406020004060400040606000406080004060A0004060C0004060
        E00040800000408020004080400040806000408080004080A0004080C0004080
        E00040A0000040A0200040A0400040A0600040A0800040A0A00040A0C00040A0
        E00040C0000040C0200040C0400040C0600040C0800040C0A00040C0C00040C0
        E00040E0000040E0200040E0400040E0600040E0800040E0A00040E0C00040E0
        E00080000000800020008000400080006000800080008000A0008000C0008000
        E00080200000802020008020400080206000802080008020A0008020C0008020
        E00080400000804020008040400080406000804080008040A0008040C0008040
        E00080600000806020008060400080606000806080008060A0008060C0008060
        E00080800000808020008080400080806000808080008080A0008080C0008080
        E00080A0000080A0200080A0400080A0600080A0800080A0A00080A0C00080A0
        E00080C0000080C0200080C0400080C0600080C0800080C0A00080C0C00080C0
        E00080E0000080E0200080E0400080E0600080E0800080E0A00080E0C00080E0
        E000C0000000C0002000C0004000C0006000C0008000C000A000C000C000C000
        E000C0200000C0202000C0204000C0206000C0208000C020A000C020C000C020
        E000C0400000C0402000C0404000C0406000C0408000C040A000C040C000C040
        E000C0600000C0602000C0604000C0606000C0608000C060A000C060C000C060
        E000C0800000C0802000C0804000C0806000C0808000C080A000C080C000C080
        E000C0A00000C0A02000C0A04000C0A06000C0A08000C0A0A000C0A0C000C0A0
        E000C0C00000C0C02000C0C04000C0C06000C0C08000C0C0A000F0FBFF00A4A0
        A000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF
        FF00FFFFFFFFFFFFFFFFFFFF0000F6F6EDD2C0C8D209F6F60000F6D2C0C0FFFF
        C0C0E4F60000DBC0C0C0C0C0C0C0C9ED0000C0C0C0C0FFFFC0C0C0D20000C0C0
        C0C0C0FFFFC0C0D20000C0C8C0FFC0C0FFC0C0D20000DBC9C0FFFFFFFFC0C9ED
        0000F6D2C9C0C0C0C0C0E4F60000F6F6EDD2C0C9DB09F6F60000}
    end
    object UsernameInput: TEdit
      Left = 8
      Top = 88
      Width = 193
      Height = 21
      TabOrder = 0
    end
    object PasswordInput: TEdit
      Left = 8
      Top = 128
      Width = 193
      Height = 21
      PasswordChar = '*'
      TabOrder = 1
    end
    object MSButton1: tMSButton
      Left = 8
      Top = 8
      Width = 75
      Height = 25
      Align = alCustom
      Caption = 'Send'
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clBlack
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentFont = False
      TabOrder = 2
      DoBrowse = False
      BrowseStyle = fbOpen
    end
  end
end
EndDialog>Dialog1

SetDialogProperty>Dialog1,,BorderIcons,[biSystemMenu,biMinimize,biMaximize]


AddDialogHandler>Dialog1,MSButton2,OnClick,DoBrowse
AddDialogHandler>Dialog1,MSButton1,OnClick,SendEmail
AddDialogHandler>Dialog1,MSImage1,OnClick,SendToInfo
AddDialogHandler>Dialog1,MSImage2,OnClick,UsernameInfo
AddDialogHandler>Dialog1,MSImage3,OnClick,PasswordInfo
Show>Dialog1,r

SRT>SendEmail
SetDialogProperty>Dialog1,MSButton1,Enabled,False
SetDialogProperty>Dialog1,MSButton1,Caption,Sending...
'Email from
GetDialogProperty>Dialog1,UsernameInput,Text,VBSEmailFrom

'Email address to send email to
GetDialogProperty>Dialog1,ToInput,Text,VBSEmailTo

'Email Subject
GetDialogProperty>Dialog1,SubjectInput,Text,VBSEmailSubject

'Email Body Text
GetDialogProperty>Dialog1,MessageBodyInput,Text,VBSEmailBody
StringReplace>%VBSEmailBody%,",'',VBSEmailBody

'Your Gmail UserID
GetDialogProperty>Dialog1,UsernameInput,Text,GmailUserName

'Your Gmail Password
GetDialogProperty>Dialog1,PasswordInput,Text,GmailPassword


'Name of Gmail Remote SMTP Server
Let>VBSEmailServer=smtp.gmail.com
'Gmail Server port (typically 465)
Let>VBSServerPort=465
'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the gmail server)
Let>VBSEmailTimeout=60
'Use SSL for the connection (Must Be True)
Let>VBSEmailSSL=True



GetDialogProperty>Dialog1,AttachmentInput,Text,VBSEmailAttachment
IfFileExists>%VBSEmailAttachment%
VBEval>SendGmailPlusAttachment("%VBSEmailSubject%","%VBSEmailFrom%","%VBSEmailTo%","%VBSEmailBody%","%VBSEmailAttachment%","%VBSEmailServer%","%GmailUserName%","%GmailPassword%",%VBSServerPort%,%VBSEmailSSL%,%VBSEmailTimeout%),res
Else
VBEval>SendGmailNoAttachment("%VBSEmailSubject%","%VBSEmailFrom%","%VBSEmailTo%","%VBSEmailBody%","%VBSEmailServer%","%GmailUserName%","%GmailPassword%",%VBSServerPort%,%VBSEmailSSL%,%VBSEmailTimeout%),res
Endif


SetDialogProperty>Dialog1,MSButton1,Enabled,True
SetDialogProperty>Dialog1,MSButton1,Caption,Send
END>SendEmail





SRT>DoBrowse
  SetDialogProperty>Dialog1,MSButton2,DoBrowse,True
  GetDialogProperty>Dialog1,MSButton2,Filename,strFileName
  SetDialogProperty>Dialog1,AttachmentInput,Text,strFileName
END>DoBrowse




SRT>SendToInfo
Let>Items=Separate multiple email addresses by comma ([email protected], [email protected])
GetCursorPos>X,Y
PopupMenu>X,Y,Items,res
END>SendToInfo

SRT>UsernameInfo
Let>[email protected]
GetCursorPos>X,Y
PopupMenu>X,Y,Items,res
END>UsernameInfo

SRT>PasswordInfo
Let>Items=Password of the email account you are sending the email from
GetCursorPos>X,Y
PopupMenu>X,Y,Items,res
END>PasswordInfo




SRT>LoadVBscrip

VBSTART
Function SendGmailPlusAttachment(VBSEmailSubject,VBSEmailFrom,VBSEmailTo,VBSEmailBody,VBSEmailAttachment,VBSEmailServer,GmailUserName,GmailPassword,VBSServerPort,VBSEmailSSL,VBSEmailTimeout)
Const cdoSendUsingPickup = 1 
Const cdoSendUsingPort = 2 
Const cdoAnonymous = 1 
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = VBSEmailSubject
objMessage.From = VBSEmailFrom
objMessage.To = VBSEmailTo
objMessage.TextBody = VBSEmailBody
objMessage.AddAttachment VBSEmailAttachment
'This section provides the configuration information for the remote SMTP server.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = VBSEmailServer
'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = GmailUserName
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = GmailPassword
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = VBSServerPort
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = VBSEmailSSL
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = VBSEmailTimeout
objMessage.Configuration.Fields.Update
objMessage.Send
End Function

Function SendGmailNoAttachment(VBSEmailSubject,VBSEmailFrom,VBSEmailTo,VBSEmailBody,VBSEmailServer,GmailUserName,GmailPassword,VBSServerPort,VBSEmailSSL,VBSEmailTimeout)
Const cdoSendUsingPickup = 1 
Const cdoSendUsingPort = 2 
Const cdoAnonymous = 1 
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = VBSEmailSubject
objMessage.From = VBSEmailFrom
objMessage.To = VBSEmailTo
objMessage.TextBody = VBSEmailBody
'objMessage.AddAttachment VBSEmailAttachment
'This section provides the configuration information for the remote SMTP server.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = VBSEmailServer
'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = GmailUserName
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = GmailPassword
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = VBSServerPort
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = VBSEmailSSL
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = VBSEmailTimeout
objMessage.Configuration.Fields.Update
objMessage.Send
End Function
VBEND

END>LoadVBscrip

MadQuestion
Pro Scripter
Posts: 70
Joined: Wed Nov 08, 2017 6:54 pm

Re: Send emails from your gmail account with UI (VBscript)

Post by MadQuestion » Sun Nov 12, 2017 7:38 pm

Do you have a version of this script for receiving emails for a gmail? Or how would you configure the above script to receive the emails rather than sending them? This is a great script, good job!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts