Microsoft Exchange API Script

Does anyone have a sample script that sends email to Microsoft Exchange?

David Quintanilla Jr.
Application Developer MKIS
Business Objects / Intranet Services
San Dimas Pax 47727


Listserv Archives (BOB member since 2002-06-25)

hi this is a little piece of script to send messages with exchange.

‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’’ ’ This routine allows to send a Mail via MAPI ‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’‘’ ’ pReciep is the one who will receive the message ’ pInfile is to use when you want to attach one file ’
Sub SendMail(strMsg as String,pReceip as string,pInFile as string)

Dim MapiSession As Object ’ Session MAPI Dim NewMail As Object ’ MailItem

Dim MailRecipient as Object ’ Personne recevant le Mail Dim nbRec as integer
on error goto erreur

’ CrÈation d’une sÈssion MAPI
Set MapiSession = CreateObject(“Mapi.Session”)

’ open session
MapiSession.Logon “zzz”

Set NewMail = MapiSession.Outbox.Messages.Add

With NewMail
set MailRecipient = NewMail.Recipients.Add MailRecipient.Name = pReceip
MailRecipient.Type = 1

’ VÈrification de l’existence du recepteur

for nbRec=1 to NewMail.recipients.count
NewMail.recipients(nbRec).resolve false
next

.Subject = strMsg
.text = strMsg
.Importance = 1

End With

IF pInFile <> “” then
call attachfile(pInFile,1,NewMail)
end if

NewMail.send false,false

MapiSession.logoff

set Mapisession = nothing
exit sub

erreur:
msgbox str(err)
End Sub

sub AttachFile(Filename as string,NoFichier as long,Message as object)

'PVR le 13/08/1998
you can attach one file
'*

Dim attachment as object

set attachment = Message.attachments.add

with attachment
.name=filename
.source=filename
.type=1 ’ fichier de donnÈes
.readfromfile filename
.Position = NoFichier * 2880
end with
message.update
end sub

for more help there is an help file
OLEMSG.HLP

if you don’t find it ask me i’ ll send you .

Bye, good luck

Philippe Vivier

De : Quintanilla, David[SMTP:QUINTAD@SCE.COM] Date : lundi 24 aošt 1998 18:21
A : BUSOB-L@LISTSERV.AOL.COM
Objet : Microsoft Exchange API Script

Does anyone have a sample script that sends email to Microsoft Exchange?

David Quintanilla Jr.
Application Developer MKIS
Business Objects / Intranet Services
San Dimas Pax 47727

Pls report bounces in response to postings to BUSOB-L-Request@listserv.aol.com
For old 3.1 info:
Penn: Page not found
Search: Mail to listserv@listserv.aol.com, ‘search a_phrase in BUSOB-L’
Unsubscribe: Mail to listserv@listserv.aol.com, ‘unsubscribe BUSOB-L’


Listserv Archives (BOB member since 2002-06-25)