473,698 Members | 2,305 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sendig emails with MAPISendMail (Mapi32.dll)

2 New Member
Hi,

I am doing an application that among other functions sends emails with Microsoft Outlook using the MAPISendMail API call.

I have two problems :
First, I would like to change the email format to HTML or at least Rich Text Format. What I can do now is text only. Is it possible?
Second, I would like to use the predefined signatures in Microsoft Outlook. The email generated by my application don’t use the signatures.

My application is developped in Microsoft Access 2002.

Thank you for your help
Dec 5 '06 #1
3 10067
NeoPa
32,569 Recognized Expert Moderator MVP
You can try with the SendObject Method.
For full help type SendObject in your code somewhere and hit F1 for context-sensitive help.
SendObject Method


The SendObject method carries out the SendObject action in Visual Basic. For more information on how the action and its arguments work, see the action topic.

Syntax

DoCmd.SendObjec t [objecttype][, objectname][, outputformat][, to][, cc][, bcc][, subject][, messagetext][, editmessage][, templatefile]

The SendObject method has the following arguments.

Argument Description

objecttype One of the following intrinsic constants:
acSendDataAcces sPage
acSendForm
acSendModule
acSendNoObject (default)
acSendQuery
acSendReport
acSendTable
objectname A string expression that's the valid name of an object of the type selected by the objecttype argument. If you want to include the active object in the mail message, specify the object's type with the objecttype argument and leave this argument blank. If you leave both the objecttype and objectname arguments blank (the default constant, acSendNoObject, is assumed for the objecttype argument), Microsoft Access sends a message to the electronic mail application without an included database object.
If you run Visual Basic code containing the SendObject method in a library database, Microsoft Access looks for the object with this name first in the library database, then in the current database.
outputformat One of the following intrinsic constants:
acFormatDAP
acFormatHTML
acFormatRTF
acFormatTXT
acFormatXLS
If you leave this argument blank, Microsoft Access prompts you for the output format.
to A string expression that lists the recipients whose names you want to put on the To line in the mail message.
Separate the recipient names you specify in this argument and in the cc and bcc arguments with a semicolon (;) or with the list separator set on the Number tab of the Regional Settings Properties dialog box in Windows Control Panel. If the recipient names aren't recognized by the mail application, the message isn't sent and an error occurs.
If you leave this argument blank, Microsoft Access prompts you for the recipients.
cc A string expression that lists the recipients whose names you want to put on the Cc line in the mail message. If you leave this argument blank, the Cc line in the mail message is blank.
bcc A string expression that lists the recipients whose names you want to put on the Bcc line in the mail message. If you leave this argument blank, the Bcc line in the mail message is blank.
subject A string expression containing the text you want to put on the Subject line in the mail message. If you leave this argument blank, the Subject line in the mail message is blank.
messagetext A string expression containing the text you want to include in the body of the mail message, after the object. If you leave this argument blank, the object is all that's included in the body of the mail message.
editmessage Use True (–1) to open the electronic mail application immediately with the message loaded, so the message can be edited. Use False (0) to send the message without editing it. If you leave this argument blank, the default (True) is assumed.
templatefile A string expression that's the full name, including the path, of the file you want to use as a template for an HTML file.
Dec 5 '06 #2
danp
2 New Member
Hi,

Thank you for your help. It works.
Dec 7 '06 #3
NeoPa
32,569 Recognized Expert Moderator MVP
Hi,

Thank you for your help. It works.
No Problem.
We're here to serve.
(Cuppa anyone :))
Dec 7 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

40
11862
by: ian | last post by:
Hi, I'm a newbie (oh no I can here you say.... another one...) How can I get Python to send emails using the default windows email client (eg outlook express)? I thought I could just do the following import win32com.client
3
5540
by: Lenard Lindstrom | last post by:
Posted in a previous thread was some Python code for accessing Window's Simple MAPI api using the ctypes module. http://groups-beta.google.com/group/comp.lang.python/msg/56fa74cdba9b7be9 This Simple MAPI module was Ian's completed version of an example I had posted in an earlier message. In it I had to set some pointer fields in a C structure to NULL. I was not happy with the solution I used so I made an inquiry on the ctypes-users...
1
5161
by: Sparky | last post by:
Hi I'm trying to send an email using the MAPISendMail API call without much luck. Has anyone got sample VB.Net code that uses MAPISendMail? I need to be able to send an email to one recipient, with one file attachment. Any help much appreciated!
2
2591
by: Eugenio | last post by:
I am doing an application that among the many activities it has to carry on, it must also send through e-mail one or more than one PDF files. I found out a similar example that do this function in the common site. In this example there is not the sender, because it rightly consider the user that is using the program. Unfortunately the application is used by a group of users and the mails they send must have the same
7
1271
by: tshad | last post by:
I am trying to figure out the best way to send automated emails? I have emails that I want to send out to certain clients that need them either daily or weekly. How would I do in asp.net? Or is it better to write normal app to handle this that I run from the schedular?
0
3000
by: Mike Loux | last post by:
Howdy, all. I am currently looking for a way to, using VB.NET, get around those annoying little "Allow Access for X Minutes" dialogs that pop up in Outlook 2003, without resorting to 3rd party add-ins, utilities, or changes to Exchange Server policies. After a lot of digging around, I came across an article on MAPILab.com that contained some VB6 source code. Here's the URL for those who are curious:
8
2124
by: MLH | last post by:
130 Targets(0) = "smtp:CRCI@NorthState.net" 135 MySubject = "Some relevant subject" 140 MyBodyText = "Blah, blah, blah" 150 Call SendMailWithOE(MySubject, MyBodyText, Targets) SendMailWithOE invokes MAPISendMail courtesy of the msoe dll in the outlook express folder. (see function declaration) Declare Function MAPISendMail _ Lib "c:\program files\outlook express\msoe.dll" ( _
1
2107
by: MLH | last post by:
130 Targets(0) = "smtp:CRCI@NorthState.net" 135 MySubject = "Some relevant subject" 140 MyBodyText = "Blah, blah, blah" 150 Call SendMailWithOE(MySubject, MyBodyText, Targets) SendMailWithOE invokes MAPISendMail courtesy of the msoe dll in the outlook express folder. (see function declaration) Declare Function MAPISendMail _ Lib "c:\program files\outlook express\msoe.dll" ( _
2
2858
by: bambi | last post by:
I tried sending an E-mail using the MAPISendMail. The mail sits/lies in my outbox as unsent. Then I have to open the E-mail in the outbox, double-click the recipient in the 'TO' box and change the E-mail option as "SMTP" from Internet, THen the mail goes off. What should I do in the coding to reflect this change. Please see the code belwo I am using /* Register the Windows OS function MAPISendMail(), callable as SendOneEMail */ ...
0
8603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2329
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.