Email Through Windows

skunal

Member
I want to send EMAIL through Windows(GUI Version). In Unix i am sending through mailx . Please can anyone help me on how to send the mail through windows(GUI version).
 

skunal

Member
Thanx for reply but here we are not using OUTLOOK or any such things we want to send the mail normal as per we send in UNIX using mailx. Is there anything of such kind in GUI .
 

TomBascom

Curmudgeon
Code:
'Usage: type msgBody | cscript mailx.vbs user@destination "subject"

'***********
'****CONFIGURE THE FROM EMAIL ADDRESS AND PASSWORD

Const fromEmail = "xyzzy@gmail.com"
Const password = "pflugh"

'****END OF CONFIGURATION
'***********

Dim emailObj, emailConfig
Dim emailBody
emailBody = ""

Do While Not WScript.StdIn.AtEndOfStream
  emailBody = emailBody & WScript.StdIn.ReadAll
Loop

Set emailObj = CreateObject("CDO.Message")
emailObj.From = fromEmail
emailObj.To = WScript.Arguments.Item(0)
emailObj.Subject = WScript.Arguments.Item(1)
emailObj.TextBody = emailBody

If WScript.Arguments.Count > 2 Then
  emailObj.AddAttachment WScript.Arguments.Item(2)
End If

Set emailConfig = emailObj.Configuration
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = true
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = fromEmail
emailConfig.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = password
emailConfig.Fields.Update

emailObj.Send

Set emailobj = nothing
Set emailConfig = nothing
 
Top