I have written a C program which will create a file, however I wanted to send that file thru mail to my mailbox. Please let me know how we can do it.
---
frmsrcurl: http://compgroups.net/comp.sys.tandem/
It would help a little to know whether you are asking about the Guardian environment or the OSS environment.
As far as I know, there is no simple email program available on NonStop any more. You do have a few options, though.
It is possible to use the TELNET program to connect to an SMTP mail server on port 23 and send the lines needed to make up the message. The SMTP protocol is a simple text protocol, so it is quite easy to send a simple message that way. It should be easy to find enough of a description of the SMTP protocol online to let you send simple messages that way. I've seen it described at some point in the past, but I don't remember where. It was pretty simple. Assuming the file you want to send contains just plain text, you would just put it in the body of the email. You probably could do an attachment via TELNET, too, but I think that would no longer qualify as a simple task.
There is a port of the mutt command line email client in the library of open source software ported to OSS (http://ituglib.connect-community.org/). If your site has OSS, you probably could install mutt and use it to send the email. If you need to use it from a TACL script, the OSH command should allow you to do that.
In previous questions about this a few years ago, some people have mentioned a sendmail program written by Lars Jansen, but it seems to have disappeared from the web since then. Maybe someone who has a local copy of it will see your question and arrange to send it to you.
Your question is too general for any answer to be helpful, I'm
afraid. Which part of sending that file to your mailbox do you really
need help with?
For a general answer, and provided Java is not foreign to your system,
start here: http://www.roseindia.net/javamail/
Also, whatever your application language is, you can access Java
routines from any language on Tandem.
> As far as I know, there is no simple email program available on NonStop any more. You do have a few options, though.
>
> It is possible to use the TELNET program to connect to an SMTP mail server on port 23 and send the lines needed to make up the message. The SMTP protocol is a simple text protocol, so it is quite easy to send a simple message that way. It should be easy to find enough of a description of the SMTP protocol online to let you send simple messages that way. I've seen it described at some point in the past, but I don't remember where. It was pretty simple. Assuming the file you want to send contains just plain text, you would just put it in the body of the email. You probably could do an attachment via TELNET, too, but I think that would no longer qualify as a simple task.
>
> There is a port of the mutt command line email client in the library of open source software ported to OSS (http://ituglib.connect-community.org/). If your site has OSS, you probably could install mutt and use it to send the email. If you need to use it from a TACL script, the OSH command should allow you to do that.
>
> In previous questions about this a few years ago, some people have mentioned a sendmail program >written by Lars Jansen, but it seems to have disappeared from the web since then. Maybe someone >who has a local copy of it will see your question and arrange to send it to you.
Wouldn't you connect to port 25 for mail? Port 23 is typically the
telserv port.
It is trivial to run sendmail and converse using the basic HELO, MAIL
FROM:, RCPT TO: and DATA commands. If you can locate the sendmail
port or use Ron Bowden's you should be all set. Alternatively you
could simply connect to a sendmail running on another box that permits
access.
I have a copy of the sendmail source code. Send me an e-mail and I'll
attach it to the reply.
I have a copy of the sourcecode of Lars Jansen's sendmail program
available. The version is v2.2 *** Modified by Jeff Artz - 02/16/2005.
Oops, you are right. It is port 25. I should have looked it up rather than relying on my memory. Thanks for the correction.
I see two other people have offered the source code for Lars Jansen's sendmail program. It probably would be easier for Akanksha to get that rather than trying to talk SMTP using telnet. If his site management is reluctant to use unsupported software and doesn't want to buy Bowden's product, then using the telnet approach is still a reasonable approach. As you say, it is not very difficult to send a simple message that way. The protocol is very easy, once you track down a description of it. He probably could figure out the protocol from looking at the source code for Jansen's program, if no other way (though I'm sure there are examples of smtp via telnet on the web).
Here is a link for the basic SENDMAIL protocol:
http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol
hope this helps,
rob