sending email in batch?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
tcpman
Posts: 53
Joined: 05 Mar 2014 15:01

sending email in batch?

#1 Post by tcpman » 06 May 2014 04:34

i saw some batch and vbs codes that do this job
but i wonder it is possible to do this without using outlook?
because most of codes using the outlook for sending emailes!

also sory i forget but which ev will point to usb drive?

one more question
i think most of you guys see some of simple graphical things in this forum for batch
how they actully do this? i mean how they work with colours in batch?(not color command)

tnx

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: sending email in batch?

#2 Post by foxidrive » 06 May 2014 05:08

tcpman wrote:i saw some batch and vbs codes that do this job
but i wonder it is possible to do this without using outlook?
because most of codes using the outlook for sending emailes!


See if you can find one here:

https://www.google.com.au/search?hl=en& ... ostips.com

also sory i forget but which ev will point to usb drive?


Wots an ev?

i think most of you guys see some of simple graphical things in this forum for batch
how they actully do this? i mean how they work with colours in batch?(not color command)


They use an executable written by a third party. There are ones posted on this site in the graphics threads.

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: sending email in batch?

#3 Post by penpen » 06 May 2014 05:30

Not always third party, but a tricky use of the (external) findstr.exe command:
http://www.dostips.com/forum/viewtopic.php?p=32630
But the third party versions are probably faster, as there is less overhead.

penpen

tcpman
Posts: 53
Joined: 05 Mar 2014 15:01

Re: sending email in batch?

#4 Post by tcpman » 06 May 2014 12:20

tnx for replay
well i mange to send email using vbs and bat and it will work only a little problem is the start command wont excute the vbs file!
but i am not sure i recived some emails but i also click on vbs file so i am not sure



by ev i mean environment variables


penpen@
tnx for that topic well the code is a little hard but i try to figure it out looks like it is easier than other codes that i have been see!

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: sending email in batch?

#5 Post by Squashman » 06 May 2014 13:43

You shouldn't need to use the start command to launch the Vbscript.
cscript //nologo email.vbs
Should work just fine.

tcpman
Posts: 53
Joined: 05 Mar 2014 15:01

Re: sending email in batch?

#6 Post by tcpman » 06 May 2014 13:59

can we give it a address? i try but looks like its accept only the filename

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: sending email in batch?

#7 Post by Squashman » 06 May 2014 16:34

tcpman wrote:can we give it a address? i try but looks like its accept only the filename

Address? Do you mean directory path?
If so, that should work just fine.

tcpman
Posts: 53
Joined: 05 Mar 2014 15:01

Re: sending email in batch?

#8 Post by tcpman » 07 May 2014 14:13

tnx
only two more problems
1-i use .AddAttachment for sending a file but its not working i think it need one more line of code
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 something like this


2-because i am wrting the info in a vbs file (using echo >>) the password of my email is visible

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: sending email in batch?

#9 Post by Squashman » 07 May 2014 14:21

Attachments

Code: Select all

objEmail.AddAttachment "C:\VBscripts\email\Attach1.txt"
objEmail.AddAttachment "C:\VBscripts\email\Attach2.txt"


Send Using.

Code: Select all

1 - Send message using the local SMTP service pickup directory.

2 - Send the message using the network (SMTP over the network).

tcpman
Posts: 53
Joined: 05 Mar 2014 15:01

Re: sending email in batch?

#10 Post by tcpman » 07 May 2014 15:39

now the only problem is the password is visible
if user wants he or she can get the password of email

is there any way that we dont need to create the vbs file but run the vbs code?
i dont know perhaps we can run the command in batch?
oh and tnx for answering my noob questions

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

Re: sending email in batch?

#11 Post by penpen » 07 May 2014 15:57

You may write a hybrid batch/vbs/wsf file and pass the password as a parameter, or read from keyboard.

See Livius method how to write such a hybrid file:
http://www.dostips.com/forum/viewtopic.php?p=33963#p33963.

penpen

Post Reply