Andrew Brzozowski
Daniel
INFODATA Luxembourg - Europe
"arbntl" <arb...@ntlworld.com> a écrit dans le message news:
kGIK9.839$9W5.1...@newsfep2-win.server.ntli.net...
Download Mvtools
-Bob
"arbntl" <arb...@ntlworld.com> wrote in message
news:kGIK9.839$9W5.1...@newsfep2-win.server.ntli.net...
Here is a VBScript used on a D3/NT System.
mail.wsf
<job>
<script language="VBScript">
Set objArgs = WScript.Arguments
Set objNewMail = CreateObject("CDONTS.NewMail")
objNewMail.From = objArgs(0)
objNewMail.To = objArgs(1)
objNewMail.Cc = objArgs(2)
objNewMail.Bcc = objArgs(3)
objNewMail.Subject = objArgs(4)
objNewMail.BodyFormat = 0
objNewMail.MailFormat = 0
objNewMail.Body = objArgs(5)
If objArgs.Count = 7 Then
objNewMail.AttachFile(objArgs(6))
End If
objNewMail.Send
Set objNewMail = Nothing
</script>
</job>
Then in a basic program create your email message, create an attachment and
copy attachment to c:\email
And create a command using the above windows script.
EMAIL.CMD = "!cscript mail.wsf"; * Windows Scrip Command
EMAIL.CMD = EMAIL.CMD : \ "\ : FROM.ADDR : \"\; * From
EMAIL.CMD = EMAIL.CMD : \ "\ : EMAIL.ADDR : \"\; * To
EMAIL.CMD = EMAIL.CMD : \ "\ : CC.ADDR : \"\; * CC
EMAIL.CMD = EMAIL.CMD : \ ""\; * Blind Copy
EMAIL.CMD = EMAIL.CMD : \ "D3 Email"\; * Subject
EMAIL.CMD = EMAIL.CMD : \ "See Email Attachment"\; * Message
EMAIL.CMD = EMAIL.CMD : ' "c:\email\' : EMAIL.ID : '"'; * Attachment
* Execute Command
EXECUTE EMAIL.CMD
Also have SMTP running on your NT Server
"arbntl" <arb...@ntlworld.com> wrote in message
news:kGIK9.839$9W5.1...@newsfep2-win.server.ntli.net...
Bonjour !
You can find a complete product (the product can send e_mails, manage
printers, send fax) on our site (www.decibel.fr). The name of the
product is Liszt (the shareware license is limited to one printer and
one fax/e_mail). No more need to create a printer under D3 (NT or Unix
release), just use the NT description of the printer and have access
to all the capabilities of your printer. Please try the product you
will have a complete support to answer to all your questions.
Thank you.
Frank Kethel
Lance
"Kilo MicroAir" <kilo...@gci.net> wrote in message
news:uvnpu7j...@corp.supernews.com...
I am certain there are lots of ways to do this, I know this works in the
way I want it to from an automated command line. Use mutt, a text based
email client that is very full featured, just green screen. It has a
command line mode as most *nix programs do. You make up a flat ASCII
text file for the contents, with optional attachment of any file you
might like to attach. The mutt uses the builtin sendmail (or whatever)
to send it out. Works fine.
Example code:
subject = "Command Line Emailing"
address = "al...@performantsystems.com"
attachment = "salesreports.pdf"
text.file = "content.txt"
**
command = \!mutt -s "\: subject
command := \ -a \: attachment
command := \ \ :address
command := \ < \:text.file
execute command
- Alan Gruskoff
www.performantsystems.com
SUBROUTINE SR.UT.UNIX.SENDMAIL (FROM.ID, BOUNCE.ID, TO.ID, SUBJECT,
REPLY.ID, MESSAGE,
ATTACHMENT, FROM.NAME, TEXT.FORMAT, ERR)
********************************************
* PROGRAM TO SEND EMAIL USING THE UNIX
* SEDNMAIL PROGRAM.
*
*
* (c) Copyright 1991 - 2002, Key Data Systems Group
* All rights reserved. 559-432-3832 USA
* JEK 11/14/2000, 10/08/2001
********************************************
*************************************************************************
* Copyright Infinetivity, Inc. 2000 as an unpublished work. All rights *
* reserved. This work is the property of and embodies confidential *
* information proprietary to Infinetivity, Inc. and shall not be *
* reproduced, copied, used, disclosed or transferred in any manner *
* without the expressed written consent of Infinetivity, Inc. *
*************************************************************************
* Written By : Mike Derheim, Southwest Data Systems
* Date Written : 11/09/2000
* Description : Updated subroutine to send email messages.
*
COMMON /KDS01/ FILES(300),KDS01.INIT
COMMON /KDS02/ KPRMS(300),KDS02.INIT
*---------------------*
*D E F I N A T I O N S*
*---------------------*
PROGRAM.NAME = 'PICK.SENDMAIL'
ERR.MSG = ''
NOW = TIME()
TODAY = DATE()
MP.HEADERS = ''
ERR = ''
AM=CHAR(254)
VM=CHAR(253)
*---------------------------*
*M A I N L I N E L O G I C*
*---------------------------*
*
* First Alloc temp file(s) and Error Checking
*
*
OPEN 'MD' TO F.MD ELSE
PRINT @(0,23):@(-4):@(0):'CANNOT OPEN FILE "MD" ':
INPUT ANY,1: ; PRINT @(0,23):@(-4):
GOTO 999
END
*
WRITE "Q":AM:AM:"unix:/tmp" ON F.MD, "UNIX.TEMP.FILE"
MY.PORT = FIELD( OCONV( '','U50BB'), ' ', 1 )
OPEN 'UNIX.TEMP.FILE' TO F.UNIX.TEMP.FILE ELSE
PRINT @(0,23):@(-4):@(0):'CANNOT OPEN FILE "UNIX.TEMP.FILE (/tmp)" ':
INPUT ANY,1: ; PRINT @(0,23):@(-4):
GOTO 999
END
*
MSTIME = SYSTEM(12)
TEMPFILE = MY.PORT:"-":MSTIME:".eml"
*
ATTCHFILE = TEMPFILE:".att"
ATTCHPATH = "/tmp/":ATTCHFILE
*
BEGIN CASE
CASE NOT(INDEX(BOUNCE.ID,'@',1))
ERR.MSG<1,-1> = 'Bounce ID must be a valid email address!'
CASE NOT(INDEX(TO.ID,'@',1))
ERR.MSG<1,-1> = 'To ID must be a valid email address!'
CASE NOT(INDEX(REPLY.ID,'@',1))
ERR.MSG<1,-1> = 'Reply-to ID must be a valid email address!'
CASE (MESSAGE = '') AND (ATTACHMENT = '')
ERR.MSG<1,-1> = 'The routine required either a message or an
attachment!'
END CASE
*
*Setup MSG Text
*
CONVERT VM TO AM IN MESSAGE
CONVERT CHAR(13) TO AM IN MESSAGE
*
* Error checking complete, now call create MIME encoded file attachment if
needed.
*
IF (ATTACHMENT # '') THEN
CALL SR.UT.SWAP (ATTACHMENT, " ", "\ ")
CALL SR.UT.SWAP (ATTACHMENT, ' ', '\ ')
CALL SR.UT.SWAP (ATTACHMENT, '\\' ,'\')
CALL SR.UT.SWAP (ATTACHMENT, '&', '\&')
CMD = '!ls ':ATTACHMENT
EXECUTE CMD CAPTURING ATT.FILE
IF NOT( INDEX( ATT.FILE, "not found", 1 ) ) THEN
MPACK = '!/usr/local/bin/mpack -s "':SUBJECT:'" -o ':ATTCHPATH:'
':ATTACHMEN
EXECUTE MPACK ;*CAPTURING JUNK
READ MP.HEADERS FROM F.UNIX.TEMP.FILE, ATTCHFILE ELSE
ERR = 'File attachment error, process aborted for ':TO.ID
RETURN
END
IF MESSAGE # '' THEN
CALL SR.UT.SWAP (MP.HEADERS, '-----', '---')
MP.HEADERS := AM:AM:AM
END
END ELSE
ERR = 'File attachment does not exist!'
RETURN
END
END
*
* C-Type for attachments.
*
IF (TEXT.FORMAT = 'H') THEN
CONVERT CHAR(10) TO AM IN MP.HEADERS
IF (ATTACHMENT # '') THEN
FOR X = DCOUNT(MP.HEADERS,AM) TO 1 STEP -1
IF(MP.HEADERS<X> = '---') THEN
MP.HEADERS<X+1> = 'Content-type: text/html;'
EXIT
END
NEXT X
END
CALL SR.UT.SWAP (MP.HEADERS, AM, CHAR(13):CHAR(10))
END
*
*Create message record with my new headers.
*
EMAIL.REC = ''
EMAIL.REC := 'From: ':FROM.NAME:'<':BOUNCE.ID:'>':CHAR(10)
EMAIL.REC := 'To: ':TO.ID:CHAR(10)
EMAIL.REC := 'Reply-to: ':REPLY.ID:CHAR(10)
EMAIL.REC := 'Subject: ':SUBJECT:CHAR(10)
EMAIL.REC := 'Return-Path: mi...@swdata.com':CHAR(10)
IF (TEXT.FORMAT = 'H') AND (ATTACHMENT = '') THEN
EMAIL.REC := 'Content-Type: text/html;':CHAR(10)
END
EMAIL.REC := MP.HEADERS:CHAR(10)
IF MESSAGE # '' THEN
EMAIL.REC := MESSAGE:CHAR(10):CHAR(10):CHAR(10)
END
EMAIL.REC := '.':CHAR(10)
EMAIL.REC := '':CHAR(10)
CONVERT AM TO CHAR(10) IN EMAIL.REC
WRITE EMAIL.REC ON F.UNIX.TEMP.FILE, TEMPFILE
*
*If no errors the send message
*
IF ERR.MSG = '' THEN
CMD = '!/usr/lib/sendmail -f ':BOUNCE.ID:' -t < /tmp/':TEMPFILE
EXECUTE CMD CAPTURING DATA RETURNING ERR.MSG
IF ERR.MSG#"0" THEN ERR = ERR.MSG
END ELSE
ERR = ERR.MSG
END
*
*Remove temp files
*
DELETE F.UNIX.TEMP.FILE, TEMPFILE
DELETE F.UNIX.TEMP.FILE, ATTCHFILE
*
* EXIT
*
999 RETURN
*
END
I hope this helps.
Jeff
--
Jeffrey Kaufman
Key Data Systems Group
www.keydat.com
559-432-3832
559-432-4657 fax
"Lance" <zzz...@zzzzzzzzzzzzzzzzzzzz.com> wrote in message
news:3dfe1...@news1.mweb.co.za...
> Recall that most of the world runs on Sendmail on Unix or Linux, so this
> is easy.
>
> I am certain there are lots of ways to do this, I know this works in the
> way I want it to from an automated command line. Use mutt, a text based
> email client that is very full featured, just green screen. It has a
> command line mode as most *nix programs do. You make up a flat ASCII
> text file for the contents, with optional attachment of any file you
> might like to attach. The mutt uses the builtin sendmail (or whatever)
> to send it out. Works fine.
>
Alan is dead on plus you can also use many other MUA (Mail user agents) to
talk to your MTA (Mail Transfer Agent). If you have a distro that doesn't
include mutt, or you are on another version of unix (HP. IBM, SUN, etc) you
can also use pine, elm, mail, mailx among others. If you want to tie your
solution to a specific MTA you can also usually call the MTA directly from
your program. Many of the other MTAs (qmail, postfix...) provide a sendmail
specific interface allowing you to use the sendmail command with them. For
more information about those commands you can issue a man command: man elm,
man sendmail or whatever.
PS: All mentioned software is open-source and thus free!
PPS: My favorite MUA for program driven email is elm, but that's only
because it is found on so many versions of unix by default.
--
kevin zollinger
ke...@mailsoap.com
Uhhh! as any true sysadmin would tell you , THE ONLY way to send mail
off a unix machine would be sendmail -vt !!!
But honestly if you are sending email off a pick system (D3, jbase,
whatever ....), I would recommand that you make a "mail subroutine" to
accept all the needed/required paramaters and then pass these onto a
unix script or perl program to do the actual mailing. if you are on
windoze then use perl (as it will run on any version of windoze) to
mail out your information.
I guess you want me to post these routines, since they work so well for us?
;^)
BTW, David M is experimenting with an email print queue (Jbase), such that any
print job sent to this queue will automatically be emailed to the sender. It
works, but sometimes kicks the print queue into I/O ERROR status. :^(
Regards,
Charlie Noah
dcha...@comcast.net (doug chanco) writes:
>Uhhh! as any true sysadmin would tell you , THE ONLY way to send mail
>off a unix machine would be sendmail -vt !!!
>
>But honestly if you are sending email off a pick system (D3, jbase,
>whatever ....), I would recommand that you make a "mail subroutine" to
>accept all the needed/required paramaters and then pass these onto a
>unix script or perl program to do the actual mailing. if you are on
>windoze then use perl (as it will run on any version of windoze) to
>mail out your information.
Charlie Noah (CWN...@aol.com)
> I'm working with a client whose running his system on D3 on an NT
> platform
That email queue is an interesting idea ..... I would be interested in
knowing how you are doing this....
also do you get emailed the output or is it reformated before being
emailed?
dougc
cwn...@aol.com (CWNoah2) wrote in message news:<20021217055611...@mb-bh.aol.com>...
Remember that Jbase print queues are set up as device=PROG lp..... ? He just
plugged in a program in place of lp. The spooler passes all the info he needed
to call EMAIL.SUB. The print job gets sent as is, as an attachment. He actually
set up 2 queues - one with normal TERM settings, and the other with page length
set to 999999. This makes a print job easy to import into Excel. He found out
what was causing the I/O ERROR status. The input buffer wasn't being emptied,
so it was generating a broken pipe error. Clearing the buffer fixed it.
Charlie
do...@chancofamily.com (doug chanco) writes:
>That email queue is an interesting idea ..... I would be interested in
>knowing how you are doing this....
>
>also do you get emailed the output or is it reformated before being
>emailed?
>
>dougc
>
>cwn...@aol.com (CWNoah2) wrote
>> Doug,
>>
>> I guess you want me to post these routines, since they work so well for us?
>> ;^)
>>
>> BTW, David M is experimenting with an email print queue (Jbase), such that
>> any print job sent to this queue will automatically be emailed to the
sender.
>> It works, but sometimes kicks the print queue into I/O ERROR status. :^(
>>
>> Regards,
>> Charlie Noah
Charlie Noah (CWN...@aol.com)
Thanks,
Greg
"Jeffrey Kaufman" <jkau...@keydat.com> wrote in message news:<8ypL9.373268$P31.139254@rwcrnsc53>...
Hmm, I guess I've never sent an attachment because I don't have mpack
either. I believe mpack is part of the mtools set, and it compresses the
attachment.
> Also, I am assumming you can replace your SR.UT.SWAP with the d3 SWAP
command.
Yes, you can use SWAP in leue or our generic swap subroutine.
I want to use your code in D3Linux (from within a program for SB+) for
sending attachments - How can I fix it ?
Kind Regards,
Lennie De Villiers
EMail: ddevi...@lando.co.za
Web: www.lando.co.za/Lennie
CV/Resume: www.lando.co.za/Lennie/CV.htm
"Real programmers don't document. If it was hard to write, it should
be hard to understand."
Pretty obvious why you need to post as an Anonymous Coward. BTW, the chicken
didn't *actually* need to cross the street. He was just wandering around. It
was just a joke.
--
Terry Layne
Portland, OR