DeveloperBarn Forums

Go Back   DeveloperBarn Forums > Programming & Scripting > Windows Scripting > VBScript

Discuss "VBS Send Mail" in the VBScript forum.

VBScript - Learn best coding practices and tips to get the best out of your VBScript code.


Reply « Previous Thread | Next Thread »  
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old March 22nd, 2008, 11:58 AM
keep_it_simple's Avatar
KIS

 
Join Date: Mar 2008
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 1
keep_it_simple is on a distinguished road

Awards Showcase
Classic ASP 
Total Awards: 1

Default VBS Send Mail

A .vbs that can be used by administrators on a 2003 environment ...plug-n-play into existing scripts for errors, forms, etc...

PHP Code:
 Function SendMessage(sSmptserverIPsSubjectsFromsTosBody)
  Const 
iSendUsing 2
  
Const iPortNum  25
  Set objMessage 
CreateObject("CDO.Message")
  
objMessage.Subject sSubject
  objMessage
.From sFrom
  objMessage
.To sTo
  objMessage
.HtmlBody sBody
  objMessage
.Configuration.Fields.Item _
  
("http://schemas.microsoft.com/cdo/configuration/sendusing") = iSendUsing
 
  objMessage
.Configuration.Fields.Item _
  
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = sSmptserverIP
  objMessage
.Configuration.Fields.Item _
  
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = iPortNum
  objMessage
.Configuration.Fields.Update
  objMessage
.Send
 End 
Function  
 
SendMessage 127.0.0.1,"Error!","KIS@yahoo.com","Joe.Blow@MSN.com","Error on server" 

Comments on this post
sbenj69 agrees:
Reply With Quote
Sponsored Links
Reply

  DeveloperBarn Forums > Programming & Scripting > Windows Scripting > VBScript

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Sponsored Links

ASP.NET Resource Index
a directory of ASP.NET tutorials, applications, scripts, assemblies and articles for the novice to professional developer.

Free Web Directory
Including Chats and Forums Resources, Offer automatic, instant and free directory submissions.
URLZ Web Directory
URLZ Web Directory

Free Web Directory - Add Your Link
The Little Web Directory
Free Web Directory
Pegasus free web directory is a free directory organised by categories.

Web Directory & SEO Services
dirroot web directory


All times are GMT -4. The time now is 12:59 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Copyright © 2008 DeveloperBarn.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46