AutoIt Forums: generating an email with an attachment - AutoIt Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

generating an email with an attachment not sending just generating

#1 User is offline   gcue 

  • Newbie
  • PipPipPipPipPip
  • Group: Full Members
  • Posts: 907
  • Joined: 24-March 04
  • Gender:Male

Posted 03 November 2009 - 04:02 PM

i am trying to generate (not send) an email with an attachment

currently, im using _inetmail but it doesnt provide an attachment option. i also saw Jos's awesome udf for sending an email using the smtp server settings.

i just want to create an email and attach a file - let the user type in recipient and click send


any ideas??

(using lotus notes)

many thanks
0

#2 User is offline   water 

  • Mass Spammer!
  • PipPipPipPipPip
  • Group: Full Members
  • Posts: 600
  • Joined: 18-September 05
  • Location:Austria

Posted 03 November 2009 - 04:13 PM

I use the following code for Outlook:
[ autoIt ]    ( Popup )
        $oOApp = ObjCreate("Outlook.Application")         $oOMail = $oOApp.CreateItem($olMailItem)             With $oOMail             .To = ($MailAn)             .Subject = "blah blah"             .BodyFormat = 2 ; $olFormatHTML             .Importance = 2 ; $olImportanceHigh             .HTMLBody = '<span style="font-family:Arial;font-size:10pt">' & _                 'The files in Directory' & _                 '<P><a href="file:///' & $Target & '">' & $Target & '</a>' & _                 '<P>have changedt.'             .Display ;   .Send         EndWith

I don't know if there is something similar for Notes.

Edit:
Searching the forum I found this.The mentioned IBM redbook "COM Togehter - with Domino" can be found here.
This post even has a script example.

This post has been edited by water: 03 November 2009 - 04:24 PM

0

#3 User is offline   gcue 

  • Newbie
  • PipPipPipPipPip
  • Group: Full Members
  • Posts: 907
  • Joined: 24-March 04
  • Gender:Male

Posted 03 November 2009 - 04:22 PM

thanks for the response!

theres ObjCreate("Notes.NotesSession")

tried this but didnt work:

[ autoIt ]    ( Popup )
$oOApp = ObjCreate("Notes.Session")         $oOMail = $oOApp.CreateItem($olMailItem)         With $oOMail             .To = ($MailAn)             .Subject = "blah blah"             .BodyFormat = 2 ; $olFormatHTML             .Importance = 2 ; $olImportanceHigh             .HTMLBody = '<span style="font-family:Arial;font-size:10pt">' & _                 'The files in Directory' & _                 '<P><a href="file:///' & $Target & '">' & $Target & '</a>' & _                 '<P>have changedt.'             .Display ;   .Send         EndWith  

This post has been edited by gcue: 03 November 2009 - 04:22 PM

0

#4 User is offline   gcue 

  • Newbie
  • PipPipPipPipPip
  • Group: Full Members
  • Posts: 907
  • Joined: 24-March 04
  • Gender:Male

Posted 03 November 2009 - 05:44 PM

this worked =) (found a vbs script and converted it)
sends the email though =/ and mailfile has to be opened..


[ autoIt ]    ( ExpandCollapse - Popup )
$oSession = ObjCreate("Notes.NotesSession") $oCurrentMailDb = $oSession.CurrentDatabase     ; Create a document in the back end      $oMailDoc = $oCurrentMailDb.CREATEDOCUMENT      $ortItem = $oMailDoc.CREATERICHTEXTITEM("Body")     with $ortItem         .AppendText("Here are the logs you requested for ") ;~         .AddNewLine(2) ;~         .AppendText("Please let me know if you need anything else.")     EndWith     $cstrAttachment = "c:\aclient.cfg"     $blAttachment = 1     If $blAttachment Then          $ortAttacment = $oMailDoc.CREATERICHTEXTITEM("Attachment")         ; Function EMBEDOBJECT(ByVal TYPE As Short, ByVal CLASS As String, ByVal SOURCE As String, Optional ByVal OBJECTNAME As Object = Nothing) As Object         ; Member of lotus.NOTESRICHTEXTITEM          $oEmbedObject = $ortAttacment.EMBEDOBJECT(1454, "", $cstrAttachment, "Attachment")      EndIf               With $oMailDoc             .SendTo = "test@test.com"             .Subject = "Logs for"             .BodyFormat = 2 ; $olFormatHTML ;~             .Importance = 2 ; $olImportanceHigh ;~             .HTMLBody = '<span style="font-family:Arial;font-size:10pt">' & _ ;~                 'The files in Directory' & _ ;~           '<P><a href="file:///' & $Target & '">' & $Target & '</a>' & _ ;~                 '<P>have changedt.'             .Display             .Send(0)         EndWith  

This post has been edited by gcue: 03 November 2009 - 05:44 PM

0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users