Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send email with attachment from AC4.3 2

Status
Not open for further replies.

traceyr

Technical User
Aug 16, 2002
41
0
0
DE
We have a requirement to generate a csv file from AC4.3 (we can do this) and send this file as an attachment with an email.
Have any of you done this, or have you any suggestion of lines of approach? Many thanks for your time.
Tracey
 
Dear Traceyr

Option 1
<--------------------------------------------
Have a look at it is a command line emailer that used with the correct parameters can email with file attachments.

You can create an action of type executable enter the appropriate information

or

via a script calling the amActionExec() function supplying the correct parameters

Option 2
<-------------------------------------
You could also take a look at which is another commandline based emailer

Pricing is
Program price is US $35 for personal
and US $50 for business license


I hope this is of some help


Jason Thomas
AssetCenter Consultant
Jason Thomas Consultancy Limited
:)
 
Jasonic is right, but you could use a VBscript as commandline emailer. This one works for Groupwise and takes 4 parameters: emailadress,subject,body, attachment.
It is rudimentary (pathetic errorchecking), but just to give you an idea:


Dim ToAddress
Dim MessageSubject
Dim MessageBody
Dim MessageAttachment
Dim ol, ns, newMail

ToAdress=wscript.arguments(0)
MessageSubject=wscript.arguments(1)
MessageBody=wscript.arguments(2)
MessageAttachment=wscript.arguments(3)

' connect to Groupwise

Set ol = WScript.CreateObject(&quot;Groupwisecommander.Application&quot;)
'use the following comment for outlook (untested).
'Set objOutlook = CreateObject(&quot;Outlook.Application&quot;)

Set ns = ol.getNamespace(&quot;MAPI&quot;)

Set newMail = ol.CreateItem(olMailItem)
newMail.Subject = MessageSubject
newMail.Body = MessageBody & vbCrLf

' validate the recipient, just in case...
Set myRecipient = ns.CreateRecipient(ToAddress)
myRecipient.Resolve
If Not myRecipient.Resolved Then
MsgBox &quot;Unknown recipient&quot;
Else
newMail.Recipents.Add(ToAddress)
newMail.Attachments.Add(MessageAttachment).Displayname = &quot;csv&quot;
newMail.Send
End If

Set ol = Nothing


save this as f.i. Postman.vbs and call it like this:

postman.vbs &quot;elvis,presley&quot;,&quot;don't be cruel&quot;,,c:/singalong.txt

You would easily find a better script than this if you 'd google on Outlook.Application
 
Thanks, Siep. That's a useful example!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top