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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System Requirements for MAPI 1

Status
Not open for further replies.

Deadline

Programmer
Feb 28, 2001
367
0
0
US
Hi,
Q1:
What are the software requirements for my system in order to develop a MAPI based application ?

I know one for sure: Visual Studio :)

What are the others ?


Q2:

Can I use CDO in place of MAPI ? Because, all I need my program to do is send mails automatically in a scheduled time, using Windows NT Task Schdeuler. No interface, no address book nothing of that sort.

Thanks in advance.

RR
 
you're better off using CDO.
The server needs a MAPI client like exchange and a registered version of CDO.DLL and your project requires a reference to CDO too.

Sub SendEmailMAPI(SendTo As String, Subject As String, EmailText As String, _
Optional AttachmentPath As String, Optional Attachment As String)
On Error GoTo ErrorHandler
Dim cdoSession As Object
Dim oFolder As Object
Dim oMsg As Object
Dim oRcpt As Object
Dim oMessages As Object

Set cdoSession = CreateObject("MAPI.Session")
cdoSession.Logon "", "", False, True, 0, True, "server" & vbLf & "mail profile"

Set oFolder = cdoSession.Outbox
Set oMessages = oFolder.Messages
Set oMsg = oMessages.Add
Set oRcpt = oMsg.Recipients
oRcpt.Add , "SMTP:" & SendTo, CdoTo
oRcpt.Resolve
oMsg.Subject = Subject
oMsg.Text = EmailText
oMsg.Send
cdoSession.Logoff

ExitMe:
Exit Sub

ErrorHandler:
WriteLog "Mailto:" & SendTo & ", Err=" & Err.Number & ", " & Err.Description
Resume ExitMe
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top