Operating System - OpenVMS
1752782 Members
6149 Online
108789 Solutions
New Discussion юеВ

Re: MAIL to internet address from DCL script

 
Paul Murray_4
Frequent Advisor

MAIL to internet address from DCL script

Hello Gurus,

I'm having a little trouble using MAIL within a DCL script.

Basically, I'm running AUTOGEN FEEDBACK and want to email the report to the sysadmins in the team. However, the email addresses are standard internet addresses rather than host specific VMS mail.

When I enter the address "admins@blah.com" from an interactive MAIL session, everything works fine. However, from within my script - nothing !!

The line in my script to send the mail is :-

$ MAIL SYS$SYSTEM:AGEN$FEEDBACK.DAT ADMINS@BLAH.COM /SUBJECT="AUTOGEN FEEDBACK"

I'm presuming that the problem revolves around the "@" sign, but I don't know how to get around it.

Any ideas ??

Regs,
Paul.


(PS - Thanks in advance !!).
Hey, nobody knows EVERYthing !!!
13 REPLIES 13
Jeroen Hartgers_3
Frequent Advisor

Re: MAIL to internet address from DCL script

syntax something like this

mail smtp:"x@a.com"
Paul Murray_4
Frequent Advisor

Re: MAIL to internet address from DCL script

Hi,

Got a little further than before - actually got an error message now :-

$ MAIL SYS$SYSTEM:AGEN$FEEDBACK.DAT SMTP:"ADMINS@BLAH.COM" /SUBJECT="AUTOGEN FEEDBACK"
%TCPIP-E-SMTP_BADADDR, recipient address is illegal; unparsed string: :@
%TCPIP-E-SMTP_ABORT, SMTP session aborted



Paul.
Hey, nobody knows EVERYthing !!!
Jan van den Ende
Honored Contributor

Re: MAIL to internet address from DCL script

Paul,

yes, it is about the @ sign, and the way around this is the VMS way around any special syntax or characters:
enclose the entire recipient specification in double quotation marks In a script you put THAT in quotation marks, and you put double those to specify them IN the string.
That results in """username@internet.address"""

hth

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Heinz W Genhart
Honored Contributor

Re: MAIL to internet address from DCL script

Hi

the correct syntax is:

$ MAIL SYS$SYSTEM:AGEN$FEEDBACK.DAT "SMTP%ADMINS@BLAH.COM" /SUBJECT="AUTOGEN FEEDBACK"

Regards

Heinz
Robert Gezelter
Honored Contributor

Re: MAIL to internet address from DCL script

Paul,

I concur, from long experience, with Jan and Heinz.

The correct syntax (presuming that you are using a base SMTP transport, not a message router such as MX) is:

$ mail filename "SMTP%""username@domain"""

Please note the multiple quotes. Quotes WITHIN a quoted string must be doubled.

- Bob Gezelter, http://www.rlgsc.com
Steven Schweda
Honored Contributor

Re: MAIL to internet address from DCL script

Regarding "the correct syntax":

And how many years has it been since the
"SMTP%" has actually been _required_ by MAIL
on an Internet address?

My advice: Stop reading replies after Feb 13,
2006 14:36:22 GMT, when "the correct answer"
was posted.

Of course, it's still legal to specify
"SMTP%" (or "WINS%", or whatever your mailer
goes by), but you can easily see for yourself
if it's needed or not.
Wim Van den Wyngaert
Honored Contributor

Re: MAIL to internet address from DCL script

I simply do :
$ mail/sub="x" file "us@wim.com"

from within the script, in batch or interactive, and without any problem.

Wim
Wim
Paul Murray_4
Frequent Advisor

Re: MAIL to internet address from DCL script

Guys,

Thanks for all the input - I just happened to try my script on another host, just by wrapping the email address in double-quotes, and the mail came through straight away.

Given that interactive MAIL works on the original server, by my script doesn't, is there a logical or something that might be missing on the other host ?

(Sorry to change the problem !!)

Regs,
Paul
Hey, nobody knows EVERYthing !!!
Wim Van den Wyngaert
Honored Contributor

Re: MAIL to internet address from DCL script

May be MAIL$INTERNET_MODE.

Check http://h71000.www7.hp.com/DOC/73final/6017/6017pro_016.html

Wim
Wim