Home » Infrastructure » Windows » Window script (windows 7 )
Window script [message #634451] Tue, 10 March 2015 04:12 Go to next message
hcdba
Messages: 34
Registered: March 2015
Member
I want some windows based script using which i can send email .

My scenario is that when in night import export backup has completed i just want that backup successful message sent to my email id

please any one can help me i m new to this forum
Re: Window script [message #634453 is a reply to message #634451] Tue, 10 March 2015 04:25 Go to previous messageGo to next message
Littlefoot
Messages: 21690
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I use BMAIL, a command line SMTP emailer.

BMAIL's parameters can be reviewed by
F:\>bmail /?

Command Line SMTP Emailer V1.07
Copyright(C) 2002-2004 Craig.Peacock@beyondlogic.org
Usage: bmail [options]
        -s    SMTP Server Name
        -p    SMTP Port Number (optional, defaults to 25)
        -t    To: Address
        -f    From: Address
        -b    Text Body of Message (optional)
        -h    Generate Headers
        -a    Subject (optional)
        -m    Filename (optional) Use file as Body of Message
        -c    Prefix above file with CR/LF to separate body from header
        -d    Debug (Show all mail server communications)


Here's an example of how my script looks like: I'm doing export and e-mail EXPDP's logfile to my e-mail address.
expdp un/pw@db parfile=exp_parfile.par

bmail -s mail.tcom.com -f i_am_the_sender@my_site.com -t i_am_the_recipient@xxx.com -a "Subject goes here" -m expdp_logfile.log -c

Re: Window script [message #634460 is a reply to message #634453] Tue, 10 March 2015 05:25 Go to previous messageGo to next message
hcdba
Messages: 34
Registered: March 2015
Member
as u said i tired...

but cant get the mail on that proper id

can u help me
Re: Window script [message #634462 is a reply to message #634460] Tue, 10 March 2015 05:31 Go to previous messageGo to next message
Littlefoot
Messages: 21690
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Maybe, if you post what you tried (copy/paste your command prompt session).
Re: Window script [message #634519 is a reply to message #634462] Wed, 11 March 2015 02:44 Go to previous messageGo to next message
hcdba
Messages: 34
Registered: March 2015
Member
First i install bmail then on cmd command i run that file


Command Line SMTP Emailer V1.07
Copyright(C) 2002-2004 Craig.Peacock@beyondlogic.org
Date: Wed, 11 Mar 2015 12:55:40 +0530
Usage: bmail [options]
-s SMTP Server Name
-p SMTP Port Number (optional, defaults to 25)
-t To: Address
-f From: Address
-b Text Body of Message (optional)
-h Generate Headers
-a Subject (optional)
-m Filename (optional) Use file as Body of Message
-c Prefix above file with CR/LF to separate body from header
-d Debug (Show all mail server communications)

then on command line i post this
bmail -s smtp.gmail.com -f abc@gmail.com -t xyz@gmail.com -a "test"

but it gives me eror like this:
Command Line SMTP Emailer V1.07
Copyright(C) 2002-2004 Craig.Peacock@beyondlogic.org
Opening connection to smtp.gmail.com [74.125.68.108] on port 25
220 mx.google.com ESMTP sm5sm4579678pac.10 - gsmtp
530 5.7.0 Must issue a STARTTLS command first. sm5sm4579678pac.10 - gsmtp

first i just want to send trial mail then i apply this to import export..

in which step i m wrong?
Re: Window script [message #634524 is a reply to message #634519] Wed, 11 March 2015 03:21 Go to previous messageGo to next message
Michel Cadot
Messages: 68042
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

This question bears no real connection with Oracle database.
Please find a more appropriate forum.
The topic is locked. /forum/fa/448/0/
If I'm wrong, please, PM me (or report this message to a moderator, explain why you think it should be unlocked and it might be done).

Re: Window script [message #634530 is a reply to message #634524] Wed, 11 March 2015 03:55 Go to previous messageGo to next message
Littlefoot
Messages: 21690
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I disagree. How is that different from, say, sending an e-mail from the database (using UTL_MAIL or UTL_SMTP or whichever option someone prefers) when some job is done? I use that option on daily basis because I want to know whether export went well or not. Instead of logging to the server and navigating to directory where log file is stored, it is a nice option to have it mailed to my inbox.


Anyway, I can't help much ... it seems that BMAIL.EXE doesn't want to work with SMTP.GMAIL.COM. It works for me, at work, but I use our own SMTP server. I have no idea which one you might use, sorry. I Googled a little bit; people suggest Blat but I never used it. Perhaps you might give it a try.
Re: Window script [message #634532 is a reply to message #634530] Wed, 11 March 2015 04:23 Go to previous messageGo to next message
Michel Cadot
Messages: 68042
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

I agree with you, this can be useful for a, say, DBA and I also do it (and this is why I didn't lock the topic yesterday).
But the problem here is just to send the email at Windows level nothing related to Oracle (in the opposite of sending an email from the database using an Oracle package).
So even if it can be useful for an Oracle guy then it does not belong to the forum, otherwise all questions can be related to Oracle in some way, even how to get a pizza can be useful.

In addition, how to send an email using gmail smtp server has already been addressed several times here with the answer this is not an Oracle problem. The problem is just that gmail requires credentials to send an email.

Re: Window script [message #634534 is a reply to message #634532] Wed, 11 March 2015 04:33 Go to previous message
Littlefoot
Messages: 21690
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Michel Cadot

The problem is just that gmail requires credentials to send an email.

Right; BMAIL can't provide them, Blat (as I read) can.
Previous Topic: How to Access files in a Server through a Local system in oracle
Next Topic: Problem Sending Email Through Outlook When Restricted User Login to Windows Server 2003 (merged 3)
Goto Forum:
  


Current Time: Tue Nov 30 06:37:17 CST 2021