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

Sending Email From VB Using Microsoft OutLook 1

Status
Not open for further replies.

motto

Programmer
May 28, 2000
23
IN
I am Using Outlook97. When I am trying to send a mail from VB 5.0 / 6.0 Using MAPI I am getting an error &quot; Either there is no default mail client or the current client cannot fulfill the messaging request&quot;.&nbsp;&nbsp;<br>How do I set the OutLook97 as my default MAPI client.<br><br>The same thing works with Outlook express.
 
I use the Outlook Object Library for this.<br><br>Public Sub SendMailMessage()<br>&nbsp;&nbsp;&nbsp;&nbsp;Dim olApp As Object, olItem As Object&nbsp;&nbsp;&nbsp;&nbsp;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Set olApp = CreateObject(&quot;Outlook.Application&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;Set olItem = olApp.CreateItem(olMailItem)<br><br>&nbsp;&nbsp;&nbsp;&nbsp;olItem.Recipients.Add &quot;<A HREF="mailto:someone@somewhere.com">someone@somewhere.com</A>&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;olItem.Subject = &quot;Some Subject&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;olItem.Body = &quot;This is the actual message&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;olItem.DeleteAfterSubmit = True<br>&nbsp;&nbsp;&nbsp;&nbsp;olItem.OriginatorDeliveryReportRequested = False<br>&nbsp;&nbsp;&nbsp;&nbsp;olItem.ReadReceiptRequested = False<br>&nbsp;&nbsp;&nbsp;&nbsp;olItem.Send<br><br>End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top