Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Send e-mail using separate SMTP server

Reply
 
Old 07-28-2009   #1 (permalink)
Robert Jacobs


 
 

Send e-mail using separate SMTP server

Experts - thanks in advance for your support!

I have a script that I would like to use to send me an e-mail when a
problem occurs. I have the script functioning properly below, but I
would like to not use microsoft's websites to help me with this, as I
have a fully functional SMTP (Lotus Domino) server sitting 4 feet
away... Is there a way to, without installing SMTP/IIS on the maching
I am running the script from, send the message to the IP Address (or
FQDN) of the SMTP server, and have it send the message for me?

Also, if I would like to attach a simple .txt file to the e-mail,
would that be possible? Here's what I have so far (which works - but
not the way I would like for it to):

Set objEmail = CreateObject("CDO.Message")
objEmail.From = "him@xxxxxx"
objEmail.To = "me@xxxxxx"
objEmail.Subject = "Test Email"
objEmail.Textbody = "This is just a test to see if I can get the e-
mail portion of the vbscript to function properly."
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"www.cd-hartnett.com"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
objEmail.Configuration.Fields.Update
objEmail.Send

My System SpecsSystem Spec
Old 07-28-2009   #2 (permalink)
Luuk


 
 

Re: Send e-mail using separate SMTP server

Robert Jacobs schreef:
Quote:

> Experts - thanks in advance for your support!
>
> I have a script that I would like to use to send me an e-mail when a
> problem occurs. I have the script functioning properly below, but I
> would like to not use microsoft's websites to help me with this, as I
> have a fully functional SMTP (Lotus Domino) server sitting 4 feet
> away... Is there a way to, without installing SMTP/IIS on the maching
> I am running the script from, send the message to the IP Address (or
> FQDN) of the SMTP server, and have it send the message for me?
>
> Also, if I would like to attach a simple .txt file to the e-mail,
> would that be possible? Here's what I have so far (which works - but
> not the way I would like for it to):
>
> Set objEmail = CreateObject("CDO.Message")
> objEmail.From = "him@xxxxxx"
> objEmail.To = "me@xxxxxx"
> objEmail.Subject = "Test Email"
> objEmail.Textbody = "This is just a test to see if I can get the e-
> mail portion of the vbscript to function properly."
> objEmail.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
> objEmail.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
> "www.cd-hartnett.com"
> objEmail.Configuration.Fields.Item _
> ("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
> = 25
> objEmail.Configuration.Fields.Update
> objEmail.Send
http://www.novatech.net/jgaa/wmailto.htm

just create a proper batchfile....

--
Luuk
My System SpecsSystem Spec
Old 07-28-2009   #3 (permalink)
Robert Jacobs


 
 

Re: Send e-mail using separate SMTP server

On Jul 28, 4:03*pm, Luuk <l...@xxxxxx> wrote:
Quote:

> Robert Jacobs schreef:
>
>
>
>
>
Quote:

> > Experts - thanks in advance for your support!
>
Quote:

> > I have a script that I would like to use to send me an e-mail when a
> > problem occurs. *I have the script functioning properly below, but I
> > would like to not use microsoft's websites to help me with this, as I
> > have a fully functional SMTP (Lotus Domino) server sitting 4 feet
> > away... *Is there a way to, without installing SMTP/IIS on the maching
> > I am running the script from, send the message to the IP Address (or
> > FQDN) of the SMTP server, and have it send the message for me?
>
Quote:

> > Also, if I would like to attach a simple .txt file to the e-mail,
> > would that be possible? *Here's what I have so far (which works - but
> > not the way I would like for it to):
>
Quote:

> > Set objEmail = CreateObject("CDO.Message")
> > objEmail.From = "h...@xxxxxx"
> > objEmail.To = "m...@xxxxxx"
> > objEmail.Subject = "Test Email"
> > objEmail.Textbody = "This is just a test to see if I can get the e-
> > mail portion of the vbscript to function properly."
> > objEmail.Configuration.Fields.Item _
> > * * ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
> > objEmail.Configuration.Fields.Item _
> > * * ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
> > * * * * "www.cd-hartnett.com"
> > objEmail.Configuration.Fields.Item _
> > * * ("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
> > = 25
> > objEmail.Configuration.Fields.Update
> > objEmail.Send
>
> http://www.novatech.net/jgaa/wmailto.htm
>
> just create a proper batchfile....
>
> --
> Luuk- Hide quoted text -
>
> - Show quoted text -
I really would not like to use any third party software or anything
like that. I will be running a script (a very complex script), that
when it encounters an error, I would like it to send an e-mail to me
to inform me, and include a log.txt file with the e-mail. I'm pretty
sure it can be done in a script, but a batch file will be fine (I can
just say, when an error occurs, run this batch file), but I don't want
to install ANY programs to perform these functions. I have an SMTP
server, and the e-mails will only be going to e-mail accounts within
the company, so it's silly to send it out over the internet, only to
have it return to our server and sent within the network - in fact, if
the internet were to go down using script above, the script would
fail...

I have scanners that can send e-mails to me using the IP Address of
that SMTP server and nothing else - so I think it should be fairly
simple to do this without using third party software or websites.

Advice appreciated!!!! Thanks!
My System SpecsSystem Spec
Old 07-28-2009   #4 (permalink)
mayayana


 
 

Re: Send e-mail using separate SMTP server

>
I really would not like to use any third party software or anything
like that
Quote:

>
There's a component here:
www.jsware.net/jsware/scripts.php5#mailer
and VB6 source code for it here:
www.jsware.net/jsware/vbcode.php5

I know you said you don't want a 3rd-party
solution. I've never used CDO so I can't help
with that. (And you also didn't say what part is
not "working the way you'd like it to".) Maybe
someone can help and you'll get it working. But
if not I don't see any reason not to use some
kind of 3rd-party option, since you seem to
only need it on a single machine.

Sending SMTP email is actually a fairly simple
and primitive operation, but you do need to
conduct a "conversation" with an SMTP server,
and for that you need some kind of component,
even if it's CDO. Emailing is not inherent functionality
in VBScript.



My System SpecsSystem Spec
Old 07-29-2009   #5 (permalink)
Luuk


 
 

Re: Send e-mail using separate SMTP server

Robert Jacobs schreef:
Quote:

> On Jul 28, 4:03 pm, Luuk <l...@xxxxxx> wrote:
Quote:

>> Robert Jacobs schreef:
>>
>>
>>
>>
>>
Quote:

>>> Experts - thanks in advance for your support!
>>> I have a script that I would like to use to send me an e-mail when a
>>> problem occurs. I have the script functioning properly below, but I
>>> would like to not use microsoft's websites to help me with this, as I
>>> have a fully functional SMTP (Lotus Domino) server sitting 4 feet
>>> away... Is there a way to, without installing SMTP/IIS on the maching
>>> I am running the script from, send the message to the IP Address (or
>>> FQDN) of the SMTP server, and have it send the message for me?
>>> Also, if I would like to attach a simple .txt file to the e-mail,
>>> would that be possible? Here's what I have so far (which works - but
>>> not the way I would like for it to):
>>> Set objEmail = CreateObject("CDO.Message")
>>> objEmail.From = "h...@xxxxxx"
>>> objEmail.To = "m...@xxxxxx"
>>> objEmail.Subject = "Test Email"
>>> objEmail.Textbody = "This is just a test to see if I can get the e-
>>> mail portion of the vbscript to function properly."
>>> objEmail.Configuration.Fields.Item _
>>> ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
>>> objEmail.Configuration.Fields.Item _
>>> ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
>>> "www.cd-hartnett.com"
>>> objEmail.Configuration.Fields.Item _
>>> ("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
>>> = 25
>>> objEmail.Configuration.Fields.Update
>>> objEmail.Send
>> http://www.novatech.net/jgaa/wmailto.htm
>>
>> just create a proper batchfile....
>>
>> --
>> Luuk- Hide quoted text -
>>
>> - Show quoted text -
>
> I really would not like to use any third party software or anything
> like that. I will be running a script (a very complex script), that
> when it encounters an error, I would like it to send an e-mail to me
> to inform me, and include a log.txt file with the e-mail. I'm pretty
> sure it can be done in a script, but a batch file will be fine (I can
> just say, when an error occurs, run this batch file), but I don't want
> to install ANY programs to perform these functions. I have an SMTP
> server, and the e-mails will only be going to e-mail accounts within
> the company, so it's silly to send it out over the internet, only to
> have it return to our server and sent within the network - in fact, if
> the internet were to go down using script above, the script would
> fail...
>
> I have scanners that can send e-mails to me using the IP Address of
> that SMTP server and nothing else - so I think it should be fairly
> simple to do this without using third party software or websites.
>
> Advice appreciated!!!! Thanks!
This complex script might become less complex if u strip out the
'complex' part of sending an email..

This software i linked to, has almos no install needed, and wil work
with you Notes server.

--
Luuk
My System SpecsSystem Spec
Old 07-29-2009   #6 (permalink)
Robert Jacobs


 
 

Re: Send e-mail using separate SMTP server

On Jul 29, 4:18*am, Luuk <l...@xxxxxx> wrote:
Quote:

> Robert Jacobs schreef:
>
>
>
>
>
Quote:

> > On Jul 28, 4:03 pm, Luuk <l...@xxxxxx> wrote:
Quote:

> >> Robert Jacobs schreef:
>
Quote:
Quote:

> >>> Experts - thanks in advance for your support!
> >>> I have a script that I would like to use to send me an e-mail when a
> >>> problem occurs. *I have the script functioning properly below, but I
> >>> would like to not use microsoft's websites to help me with this, as I
> >>> have a fully functional SMTP (Lotus Domino) server sitting 4 feet
> >>> away... *Is there a way to, without installing SMTP/IIS on the maching
> >>> I am running the script from, send the message to the IP Address (or
> >>> FQDN) of the SMTP server, and have it send the message for me?
> >>> Also, if I would like to attach a simple .txt file to the e-mail,
> >>> would that be possible? *Here's what I have so far (which works - but
> >>> not the way I would like for it to):
> >>> Set objEmail = CreateObject("CDO.Message")
> >>> objEmail.From = "h...@xxxxxx"
> >>> objEmail.To = "m...@xxxxxx"
> >>> objEmail.Subject = "Test Email"
> >>> objEmail.Textbody = "This is just a test to see if I can get the e-
> >>> mail portion of the vbscript to function properly."
> >>> objEmail.Configuration.Fields.Item _
> >>> * * ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
> >>> objEmail.Configuration.Fields.Item _
> >>> * * ("http://schemas.microsoft.com/cdo/configuration/smtpserver")= _
> >>> * * * * "www.cd-hartnett.com"
> >>> objEmail.Configuration.Fields.Item _
> >>> * * ("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
> >>> = 25
> >>> objEmail.Configuration.Fields.Update
> >>> objEmail.Send
> >>http://www.novatech.net/jgaa/wmailto.htm
>
Quote:
Quote:

> >> just create a proper batchfile....
>
Quote:
Quote:

> >> --
> >> Luuk- Hide quoted text -
>
Quote:
Quote:

> >> - Show quoted text -
>
Quote:

> > I really would not like to use any third party software or anything
> > like that. *I will be running a script (a very complex script), that
> > when it encounters an error, I would like it to send an e-mail to me
> > to inform me, and include a log.txt file with the e-mail. *I'm pretty
> > sure it can be done in a script, but a batch file will be fine (I can
> > just say, when an error occurs, run this batch file), but I don't want
> > to install ANY programs to perform these functions. *I have an SMTP
> > server, and the e-mails will only be going to e-mail accounts within
> > the company, so it's silly to send it out over the internet, only to
> > have it return to our server and sent within the network - in fact, if
> > the internet were to go down using script above, the script would
> > fail...
>
Quote:

> > I have scanners that can send e-mails to me using the IP Address of
> > that SMTP server and nothing else - so I think it should be fairly
> > simple to do this without using third party software or websites.
>
Quote:

> > Advice appreciated!!!! *Thanks!
>
> This complex script might become less complex if u strip out the
> 'complex' part of sending an email..
>
> This software i linked to, has almos no install needed, and wil work
> with you Notes server.
>
> --
> Luuk- Hide quoted text -
>
> - Show quoted text -
Thank you - I wish I could explain better... Here's my best attempt:

This script will be run on a server, a server that takes orders from
remote devices. The server has NO software installed, and everything
is script driven, so if something were to happen to the server (crash,
etc...) we could literally restore the server to it's bare bones, put
these scripts into the startup, and it would be working again. We
don't want to have to remember to go get this piece of software to do
this, and that piece of software to do that, and make sure this is
installed before that so that they can work together. Or, if the next
version of Windows server isn't compatable with that program, we don't
have to go find another piece of software to replace it... Just
install windows, run the script, and walk away. There are additional
reasons for this as well...

Thanks for responding, telling me that I shouldn't do what I'm doing,
and to use 3rd party software anyway (and to mayayana, when you said:
"(And you also didn't say what part is
not "working the way you'd like it to".)", I did explain it - the
current script uses Microsoft's websites to do my SMTP communications
instead of my own SMTP server, and I don't want it to). I will just
have to keep looking - I'm sure somebody will be able to tell me how
to, using a script or batch file, connect to an existing SMTP server
and have it send a simple e-mail without third party software.
My System SpecsSystem Spec
Old 10-22-2009   #7 (permalink)
Si Ballenger


 
 

Re: Send e-mail using separate SMTP server

On Tue, 28 Jul 2009 13:51:20 -0700 (PDT), Robert Jacobs
<robertjacobsit@newsgroup> wrote:
Quote:

>Experts - thanks in advance for your support!
>
>I have a script that I would like to use to send me an e-mail when a
>problem occurs. I have the script functioning properly below, but I
>would like to not use microsoft's websites to help me with this, as I
>have a fully functional SMTP (Lotus Domino) server sitting 4 feet
>away... Is there a way to, without installing SMTP/IIS on the maching
>I am running the script from, send the message to the IP Address (or
>FQDN) of the SMTP server, and have it send the message for me?
>
>Also, if I would like to attach a simple .txt file to the e-mail,
>would that be possible? Here's what I have so far (which works - but
>not the way I would like for it to):
Below is a site with some good info. Bottom is some code I've
used in the past with a batch file (watch for word wrap).

http://www.paulsadowski.com/WSH/cdo.htm


Set objArgs = WScript.Arguments
Set objEmail = CreateObject("CDO.Message")
objEmail.From = objArgs(0)
objEmail.To = objArgs(1)
objEmail.Subject = objArgs(2)
objEmail.Textbody = objArgs(3)
objEmail.AddAttachment "C:\Documents and
Settings\zoomkat\Desktop\asciifull.gif"
with objEmail.Configuration.Fields
.Item
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
objArgs(4)
.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
.Item
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")
= 1
.Item
("http://schemas.microsoft.com/cdo/configuration/sendusername") =
objArgs(5)
.Item
("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
objArgs(6)
.Item
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") =
False
.Item
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout")
= 25
.Update
end with
objEmail.Send

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Cannot send mail due to SMTP server error Vista mail
how to send email if my SMTP server requires authentication VB Script
smtp outgoing server will not allow me to send mail with attachmen Vista mail
Outgoing mail SMTP server Vista mail
Smtp server not allowing to send emails Vista mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

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