1.

Solve : Email through DOS prompt.?

Answer»

Hi,

Is it possible to send email to my company email-id from a batch job or through DOS. I dont wanna use any third party software.

Thanks.
-BobQuote from: bobcatalog on July 30, 2008, 12:01:51 PM

Hi,

Is it possible to send email to my company email-id from a batch job or through DOS. I dont wanna use any third party software.

Thanks.
-Bob

Are you really running DOS? If you have a Windows machine you can use VBScript or JSCRIPT. There is a 3rd party product called blat which is similar to the unix sendmail command. There is no native DOS support for email.

Hi Sidewinder,

Thanks for the info. btw do you have the code in vbscript for sending mail?

Thanks,
-BobQuote
btw do you have the code in vbscript for sending mail

Are you kidding? The snippet closet is bottomless. (hmmm, that wording may be a BIT awkward)

This is a basic shell to send email with VBScript. Check with your ISP for the actual value of the smtpserver, port and whether you need to use authentication (most of this information is available online). There are other PARAMETERS for attachments, etc.

Code: [Select]Set CDO = CreateObject("CDO.Message")
CDO.From =
CDO.To =
CDO.Subject = "Test Email"
CDO.Textbody = "Whassup?"
CDO.Configuration.Fields.Item("HTTP://schemas.microsoft.com/cdo/configuration/sendusing") =
CDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
CDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") =
CDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") =
CDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
CDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") =
CDO.Configuration.Fields.Update
CDO.Send

Save the file with a vbs extension and run from the command line as cscript scriptname.vbs



PS. There is a special PLACE in *censored* for spammers.


Discussion

No Comment Found