Link a Documento Flash" Call stream.WriteText(bodyHtml+linkFlash ) Call child3.SetContentFromText(stream,"text/html;charset=iso-8859-1",ENC_NONE) Call stream.Close docMail.Principal = Originator '## the spoofing With docMail .Form = "Memo" 'From .From = mittente 'To (Destinatari) .SendTo = destinatarioNomeVisualizzato 'Recipients .Recipients = destinatario 'Subject .Subject = Subject 'allegato 'Set rtitem = New NotesRichTextItem( docMail, "Body" ) 'Call rtitem.AppendText( szBody ) '.Subject = rtitem.EmbedObject( EMBED_ATTACHMENT, "", fileAllegato ) %REM 'Body .Body = bodyHtml End With %END REM End With Call docMail.Save(True, True) 'session.ConvertMIME = True '## Restore conversion 'MATTEO COMMENTATO 'sending: 'MATTEO COMMENTATO 'docMail.Send False 'Sleep(1) '## to reduce the load on the server, it sleeps for one second between sendings Exit Function End Function ">
> |  
Invio email con allegato
MatteoRoma81
Salve a tutti ragazzi, sono nuovo di questo forum.
Vi pongo il mio problema.
Utilizzo lotus domino 6.5 Ho un problema con un Agent in particolare la funzione "Function CreateAndSend".
Questa funziona permette di inviare le mail formattate in HTML, la e-mail viene inviata correttamente ma non riesco ad allegare un file alla e-email. Potete aiutarmi o suggerimi qualche esempio approrpriato alla mia situazione?
Inoltre cercando soluzioni su internet ho provato ad inglobare questi 2 esempi di attachment (che mi sembrano abb. attendibili) alla mia funzione, ma conosco poco lotusScript. Magari possono aiutarvi ad aiutarmi.
http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/c11317221ca8f8de8525724a0041a78e?OpenDocument&Highlight=0,agent,attach,excel,mail

http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/14f32f83a8691ad0852571d90033c9e2?OpenDocument

Grazie anticipatamente. Vi copio la funzione:


Function CreateAndSend (session As NotesSession, msg_text As String, bodyHtml As String, destinatario As String, destinatarioNomeVisualizzato As String, mittente As String, Originator As String, Subject As String, szLinkRichiesta As String, fileAllegato As String)
\'## feed this function with
\'## NotesSession
\'## text for the text alternative to the HTML
\'## the HTML as text
\'## The email address of the recipient
\'## the email address of who you want it to be "from"
\'## the subject line as text
\'## Create the email document

Set docMail = dbMailBox.CreateDocument
session.ConvertMIME = False \'## Do not convert MIME to rich text
Set stream = session.CreateStream
Set body = docMail.CreateMIMEEntity

Set header = body.CreateHeader("Content-Type")
Call header.SetHeaderVal("multipart/alternative")
\'Set header = body.CreateHeader("Subject") \'momentaneo
\'Call header.SetHeaderVal(Subject) \'momentaneo


%REM
Set header = body.CreateHeader("Subject")
Call header.SetHeaderVal(Subject)
Set header = body.CreateHeader("To")
Call header.SetHeaderVal(Recipient)
Set child2 = body.CreateChildEntity
Call stream.WriteText(msg_text)
Call child2.SetContentFromText(stream,"text/plain;charset=iso-8859-1",ENC_NONE)
Call stream.Close
%END REM

Set child3 = body.createchildEntity
linkFlash = "<br><A href="+szLinkRichiesta+">Link a Documento Flash</A>"
Call stream.WriteText(bodyHtml+linkFlash )
Call child3.SetContentFromText(stream,"text/html;charset=iso-8859-1",ENC_NONE)
Call stream.Close
docMail.Principal = Originator \'## the spoofing

With docMail
.Form = "Memo"

\'From
.From = mittente

\'To (Destinatari)
.SendTo = destinatarioNomeVisualizzato

\'Recipients
.Recipients = destinatario

\'Subject
.Subject = Subject

\'allegato
\'Set rtitem = New NotesRichTextItem( docMail, "Body" )
\'Call rtitem.AppendText( szBody )
\'.Subject = rtitem.EmbedObject( EMBED_ATTACHMENT, "", fileAllegato )

%REM
\'Body
.Body = bodyHtml
End With
%END REM
End With


Call docMail.Save(True, True)
\'session.ConvertMIME = True \'## Restore conversion \'MATTEO COMMENTATO
\'sending: \'MATTEO COMMENTATO
\'docMail.Send False
\'Sleep(1) \'## to reduce the load on the server, it sleeps for one second between sendings

Exit Function
End Function






You are here Invio email con allegato - MatteoRoma81 -
    re : Invio email con allegato - Daniele -