send mail from C program

  • Follow


Hi,

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.
0
Reply Akanksha 6/29/2010 6:07:13 PM

Akanksha wrote:
> Hi,
> 
> 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.
0
Reply KeithDick (286) 6/29/2010 11:03:44 PM


> 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.

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.
0
Reply demoungu (305) 6/29/2010 11:26:50 PM

On Jun 29, 7:03=A0pm, Keith Dick <KeithD...@earthlink.net> wrote:

> As far as I know, there is no simple email program available on NonStop a=
ny more. =A0You do have a few options, though.
>
> It is possible to use the TELNET program to connect to an SMTP mail serve=
r on port 23 and send the lines needed to make up the message. =A0The SMTP =
protocol is a simple text protocol, so it is quite easy to send a simple me=
ssage that way. =A0It should be easy to find enough of a description of the=
 SMTP protocol online to let you send simple messages that way. =A0I've see=
n it described at some point in the past, but I don't remember where. =A0It=
 was pretty simple. =A0Assuming the file you want to send contains just pla=
in text, you would just put it in the body of the email. =A0You probably co=
uld do an attachment via TELNET, too, but I think that would no longer qual=
ify as a simple task.
>
> There is a port of the mutt command line email client in the library of o=
pen source software ported to OSS (http://ituglib.connect-community.org/). =
=A0If your site has OSS, you probably could install mutt and use it to send=
 the email. =A0If you need to use it from a TACL script, the OSH command sh=
ould allow you to do that.
>
> In previous questions about this a few years ago, some people have mentio=
ned a sendmail program >written by Lars Jansen, but it seems to have disapp=
eared from the web since then. =A0Maybe 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.

0
Reply mustlearntandem (380) 6/30/2010 12:43:23 PM

> In previous questions about this a few years ago, some people have mentio=
ned a sendmail program written by Lars Jansen, but it seems to have disappe=
ared from the web since then. =A0Maybe someone who has a local copy of it w=
ill see your question and arrange to send it to you.

I have a copy of the sendmail source code. Send me an e-mail and I'll
attach it to the reply.
0
Reply RichardSmrekar (32) 6/30/2010 1:32:20 PM

On 30 Jun., 14:43, mustlearntandem <mustlearntan...@netscape.net>
wrote:
> On Jun 29, 7:03=A0pm, Keith Dick <KeithD...@earthlink.net> wrote:
>
> > As far as I know, there is no simple email program available on NonStop=
 any more. =A0You do have a few options, though.
>
> > It is possible to use the TELNET program to connect to an SMTP mail ser=
ver on port 23 and send the lines needed to make up the message. =A0The SMT=
P protocol is a simple text protocol, so it is quite easy to send a simple =
message that way. =A0It should be easy to find enough of a description of t=
he SMTP protocol online to let you send simple messages that way. =A0I've s=
een it described at some point in the past, but I don't remember where. =A0=
It was pretty simple. =A0Assuming the file you want to send contains just p=
lain text, you would just put it in the body of the email. =A0You probably =
could do an attachment via TELNET, too, but I think that would no longer qu=
alify 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/)=
.. =A0If your site has OSS, you probably could install mutt and use it to se=
nd the email. =A0If 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 ment=
ioned a sendmail program >written by Lars Jansen, but it seems to have disa=
ppeared from the web since then. =A0Maybe 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? =A0Port 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. =A0If you can locate the sendmail
> port or use Ron Bowden's you should be all set. =A0Alternatively you
> could simply connect to a sendmail running on another box that permits
> access.

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.
0
Reply wolfgang.breidbach (563) 6/30/2010 1:35:49 PM

mustlearntandem wrote:
> On Jun 29, 7:03 pm, Keith Dick <KeithD...@earthlink.net> wrote:
> 
> 
>>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.
> 

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). 
0
Reply KeithDick (286) 6/30/2010 2:19:20 PM

On Jun 29, 1:07=A0pm, Akanksha <u...@compgroups.net/> wrote:
> Hi,
>
> 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/

Here is a link for the basic SENDMAIL protocol:

http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol

hope this helps,

rob
0
Reply rm.hutchings (168) 7/1/2010 2:52:05 AM

7 Replies
286 Views

(page loaded in 0.548 seconds)

Similiar Articles:













7/24/2012 6:11:30 AM


Reply: