Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to send email from vbscript? 2

Status
Not open for further replies.

jfdabiri

MIS
Feb 27, 2007
282
US
hi,
i'm using grouwise. not sure if smtp is enabled or if it's using its own stuff. but i haven't been able to set up a command to send email from vbscript using groupwise.
there's a piece of code that is posted in vba that's using groupwise to send from access in the form docmd.sendsubject
but i'm not sure how to subtitute a run command or something for docmd? maybe that would work?
Code:
DoCmd.SendObject , , , "me@myemail.com", , , "Audit Due", " Attached is the Audit tool for the " & [TaskDescription] & " Audit.  Please print, complete and return to me as soon as possilbe.", -1, Attchmnt
 
Have you had a look at GWSend (
It lets you send messages using basic Groupwise options, e.g. filling the recipient list, adding attachments, specifying user names, etc.

As GWSend is a Win32 console application, you can use it to send GroupWise messages from a command line or from batch files, i.e. it's scriptable.

Sounds just what you are looking for. Hope this helps...
 
longhair and rick
thanks so much for the replies. i'm not sure what blat is.
i'm not sure what GWsend is either. can you elaborate?
how would i use gwsend? or blat?
thanks again.
 
ok,
i checked that site. gwsend seems to be what i want. i have to wait and see if i can implement it in a vbscript.
thanks so much.
 
Have a look at for syntax and some examples of use.

I haven't used GWSend but a very basic example using VBScript would look something like this:

Code:
Set WShell = CreateObject("WScript.Shell")
WShell.run ("C:\gwsend.exe /t=jfdabiri@my_company.com /s="This is the subject" /m="This is the message text" /a=C:\attached.doc")
Set WShell = nothing

I also found some info about using VB at
Hope this helps...
 
This is how I send email from vbscript...

Code:
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Subject"
objMessage.From = "youremail@yahoo.com"
objMessage.To = "toemail@yahoo.com"
objMessage.TextBody = "The Body of your email"
objMessage.AddAttachment "c:\anyattachement.txt"
objMessage.Send
 
thanks so much everyone.
i got it to work with groupwise as was shown on wolfgang shreiber's site. it works ok.
i'm not sure if groupwise uses smtp and pop3. because when i tried cdo.message, it wouldn't work.
thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top