Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-31-2008, 11:02 PM
dwmurray57 dwmurray57 is offline
Registered User
 
Join Date: Aug 2008
Posts: 2
Sending an Email from within a script?

Hi All,

I am not very familiar with scripting (other than look for certain stings and put out some text), but what I need to do is if I find a very specific string, I need to send an Email at that
time.

Would someone have a suggestion / example on how to do this?

Thank you in advance for your time,

Doug!
Reply With Quote
  #2  
Old 09-02-2008, 10:06 AM
tnygren's Avatar
tnygren tnygren is offline
Registered User
 
Join Date: May 2005
Posts: 1,408
Hi Doug,

In VBScript, there is an object (CDO) that will allow you to create and send emails from within a script.

I have attached a sample script that shows how this object can be used.

Was this the information needed?
Attached Files
File Type: txt SendEmail.txt (6.7 KB, 275 views)
__________________
Thanks,

Teresa

Teresa Nygren
Reply With Quote
  #3  
Old 09-10-2008, 06:39 AM
sachinmlr sachinmlr is offline
Registered User
 
Join Date: Sep 2008
Posts: 4
Need more info

Well... in that script(SendEmail.vbs),

Dim g_szSMTPServer : g_szSMTPServer = "192.168.0.1",

i 'm bit confused with it as i 'm not running any local smtp server in my system.

Is it possible to use some third party mailing services like gmail/yahoo, ...?

im just trying to mail the output one shell command to my e-mail address. But i don't 've enough privilege use sendmail/mail feature available in the box in which i 'm trying to run the mailing script.

Suggestion would be entertained.
Reply With Quote
  #4  
Old 10-16-2008, 02:44 AM
sachinmlr sachinmlr is offline
Registered User
 
Join Date: Sep 2008
Posts: 4
That sendEmail script assumes that the e-mail sever support relaying!

That sendEmail script assumes that the e-mail sever support relaying mechanism, which hardly any of the available e-mail servers support.

Is there any work around for this?
Reply With Quote
  #5  
Old 10-16-2008, 09:03 AM
tnygren's Avatar
tnygren tnygren is offline
Registered User
 
Join Date: May 2005
Posts: 1,408
Hi Sachinmlr,

The CDO object is not a VanDyke scripting object, rather it is provided by Microsoft as a component installed with Windows.

At first glance, it appears that CDO only supports SMTP/NNTP.

However, it would appear that gmail does support SMTP as well -- see the following link:
http://mail.google.com/support/bin/a...n&answer=13287
You might find success in setting the "from" to your gmail address, the SMTP server to "smtp.gmail.com", and SMTP port to "587".

Also, since gmail appears to require SSL, you'll probably need to set additional options:
  • schemas.microsoft.com/cdo/configuration/smtpusessl should probably be set to True.
  • schemas.microsoft.com/cdo/configuration/smtpauthenticate should probably be set to 1 (one)
  • schemas.microsoft.com/cdo/configuration/sendusername should probably be set to your gmail e-mail address.
  • schemas.microsoft.com/cdo/configuration/sendpassword should probably be set to your gmail account password

Does this information help?
__________________
Thanks,

Teresa

Teresa Nygren

Last edited by jdev; 10-16-2008 at 11:40 AM.
Reply With Quote
  #6  
Old 10-17-2008, 10:03 PM
sachinmlr sachinmlr is offline
Registered User
 
Join Date: Sep 2008
Posts: 4
Need assitance.

Thanks for your response.

Yes I'm fully aware of the fact that CDO(cdont etc) 're Microsoft products used for sending mails.

Well i 've send a mail to you. Looking forward for your reply.

~Sachin.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT -6. The time now is 08:07 AM.