HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

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
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
Jan van den Ende
Honored Contributor

Re: MAIL to internet address from DCL script

Wim,

I do not think that that applies here:

ADMINS@BLAH.COM

contains a full stop at the right of the @ sign, and then MAIL$INTERNET_MODE is not necessary to resolve the addressing style.

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Wim Van den Wyngaert
Honored Contributor

Re: MAIL to internet address from DCL script

Jan,

If it is defined as decnet, all addresses are interpreted as decnet addresses and the @ is invalid. I think.

Paul will tell. I hope.

Wim
Wim
Thomas Ritter
Respected Contributor

Re: MAIL to internet address from DCL script

Paul, to send SMTP mail using a distribution list the syntax is like this

$ mail/subject="Stuff" file.dat @mail.dis

where mail.dis has the SMTP formats like
this
"smtp%rover@team.company.com",-
"smtp%dog@team.company.com"
Dave Laurier
Frequent Advisor

Re: MAIL to internet address from DCL script


You may benefit from the sendmail.com script that can be found at http://dcl.openvms.org.

This script allows one to send MIME or SMTP messages and allows files to be attached.