473,666 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Email with MS Access and CDO: showdialog before sending

I have the following example code. I'm using CDO as I need to specify the
sender.

Set objMessage = CreateObject("C DO.Message")
objMessage.Subj ect = "Example CDO Message"
objMessage.From = my************@ dot.com
objMessage.To = te*********@dot .com
objMessage.Text Body = "This is some sample message text."
objMessage.Send

which works, but I have 2 questions:

1. I added the code <<showDialog:=F alse>(behind objMessage.Send )
as I want to view the message before I confirm sending. The code is not
accepted.
How can I make this work?

2. I notice that emails that are being send don't end up in my 'sent box'.
Is that possible to achieve?

Thanks in advance,
john
Oct 7 '07 #1
4 6447
"john" <hg*@neckso.com wrote in
news:77******** *************** ***@cache120.mu ltikabel.net:
I have the following example code. I'm using CDO as I need to specify
the sender.

Set objMessage = CreateObject("C DO.Message")
objMessage.Subj ect = "Example CDO Message"
objMessage.From = my************@ dot.com
objMessage.To = te*********@dot .com
objMessage.Text Body = "This is some sample message text."
objMessage.Send

which works, but I have 2 questions:

1. I added the code <<showDialog:=F alse>(behind objMessage.Send )
as I want to view the message before I confirm sending. The code is
not accepted.
How can I make this work?

2. I notice that emails that are being send don't end up in my 'sent
box'. Is that possible to achieve?

Thanks in advance,
john
Perhaps, you are trying to use two object models interchangeably .

Typically CDO does not interact directly with Outlook or your default e-
mail program, although it may use values set in Outlook Express.
TTBOMK CDO does not include an object, property or method called
"showDialog "

It would be helpful if you tell us what you are trying to accomplish and/or
show us the whole module, using copy and paste.

--
lyle fairfield

Ceterum censeo Redmond esse delendam
Oct 7 '07 #2

"lyle fairfield" <ly******@yahoo .caschreef in bericht
news:te******** *********@read2 .cgocable.net.. .
"john" <hg*@neckso.com wrote in
news:77******** *************** ***@cache120.mu ltikabel.net:
>I have the following example code. I'm using CDO as I need to specify
the sender.

Set objMessage = CreateObject("C DO.Message")
objMessage.Sub ject = "Example CDO Message"
objMessage.Fro m = my************@ dot.com
objMessage.T o = te*********@dot .com
objMessage.Tex tBody = "This is some sample message text."
objMessage.Sen d

which works, but I have 2 questions:

1. I added the code <<showDialog:=F alse>(behind objMessage.Send )
as I want to view the message before I confirm sending. The code is
not accepted.
How can I make this work?

2. I notice that emails that are being send don't end up in my 'sent
box'. Is that possible to achieve?

Thanks in advance,
john

Perhaps, you are trying to use two object models interchangeably .

Typically CDO does not interact directly with Outlook or your default e-
mail program, although it may use values set in Outlook Express.
TTBOMK CDO does not include an object, property or method called
"showDialog "

It would be helpful if you tell us what you are trying to accomplish
and/or
show us the whole module, using copy and paste.

--
lyle fairfield

Ceterum censeo Redmond esse delendam
The above code (in a button's click) is all there is and that works. I'm
trying to accomplish 2 things:

1. The user needs to be able to send a message on behalf of another (not
person-related) mailbox for which he is authorised.

2. The user needs to see the message first before he confirms to send it.

With the sendobject- and Outlook mailmethods I'm not able to set the
'sender' or 'From' property.

Thanks,
john
Oct 7 '07 #3
On Oct 7, 9:36 am, "john" <h...@neckso.co mwrote:
"lyle fairfield" <lylef...@yahoo .caschreef in berichtnews:te* *************** *@read2.cgocabl e.net...
"john" <h...@neckso.co mwrote in
news:77******** *************** ***@cache120.mu ltikabel.net:
I have the following example code. I'm using CDO as I need to specify
the sender.
Set objMessage = CreateObject("C DO.Message")
objMessage.Subj ect = "Example CDO Message"
objMessage.From = myemailaddr...@ dot.com
objMessage.To = testaddr...@dot .com
objMessage.Text Body = "This is some sample message text."
objMessage.Send
which works, but I have 2 questions:
1. I added the code <<showDialog:=F alse>(behind objMessage.Send )
as I want to view the message before I confirm sending. The code is
not accepted.
How can I make this work?
2. I notice that emails that are being send don't end up in my 'sent
box'. Is that possible to achieve?
Thanks in advance,
john
Perhaps, you are trying to use two object models interchangeably .
Typically CDO does not interact directly with Outlook or your default e-
mail program, although it may use values set in Outlook Express.
TTBOMK CDO does not include an object, property or method called
"showDialog "
It would be helpful if you tell us what you are trying to accomplish
and/or
show us the whole module, using copy and paste.
--
lyle fairfield
Ceterum censeo Redmond esse delendam

The above code (in a button's click) is all there is and that works. I'm
trying to accomplish 2 things:

1. The user needs to be able to send a message on behalf of another (not
person-related) mailbox for which he is authorised.

2. The user needs to see the message first before he confirms to send it.

With the sendobject- and Outlook mailmethods I'm not able to set the
'sender' or 'From' property.

Thanks,
john
E-mail security is set up to prevent, more-or-less, what you want to
do. I suppose you could expose the message for editing in an Access
form and include a button which would send or abort it.
(Your code requires quotation marks around literals, the to and from
addresses.)

Oct 7 '07 #4
E-mail security is set up to prevent, more-or-less, what you want to
do. I suppose you could expose the message for editing in an Access
form and include a button which would send or abort it.
(Your code requires quotation marks around literals, the to and from
addresses.)
Thanks.
About the quotation marks, I accidentally removed them while changing the
email addresses for the newsgroup post.

john
Oct 7 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7076
by: JSzucs | last post by:
I wrote a little code snipet in Asp.Net to send a default message to my outlook email address. That works fine, since the SMTP virtual server default domain is same domain as my outlook mail server: myMessage.To = "jszucs@universalmoney.com" myMail.SmtpServer = "mail.universalmoney.com" But when I try to sent to blabblab@page.nextel.com, I get the following error:
19
2784
by: Bill | last post by:
I have searched through the posts for a question like mine but have only found much more complicated responses. On single record view of a form I have an email address field. I merely want to create a button that will email the same message (and idealy a word attachment) to whatever address is in view on the form (chances are that I just input it). For further explanation:
17
2891
by: Bonj | last post by:
Right guys. (I would like a solution to this in VB6 as this is what our needy app is written in, but any solutions that involve .NET would be much appreciated likewise as I could instantiate them, otherwise please forgive the crossposting.) I'm sure I've seen posts here before criticising the practice of automating outlook for the purpose of programatically sending email, on the grounds that it's naff. Well now we're really landed in...
2
3511
by: RedEye | last post by:
Hello, I am trying to create a class to send email via POP3 or Exchange. Everything works fine when sending via POP3 but fails when sending via exchange. Error: Could not access 'CDO.Message' object. The following code works fine in a VB.Net test app but fails on the web. Does anyone have an idea why??
5
2058
by: Nick 'The Database Guy' | last post by:
It used to be possible to send email (with the DoCmd.SendObject acSendNoObject, , , "nickmcm@btinternet.com", , , "Email", "Enquiry", False command), however since 2000, Microsoft has put a restraint on this, so each email that goes out you have to confirm that Access is allowed to use Outlook. Is there anyway round this that anyone knows of, obviously I do not want to confirm 400 times (or more) that everthing is above board. Thanks...
3
4689
by: sentiboy | last post by:
I am using the following code for sending email through mapi in VS 2005 environment: Public objSession As New MSMAPI.MAPISession Public objMessage As New MSMAPI.MAPIMessages objSession.DownLoadMail = False objSession.UserName = "MyUsername" objSession.Password = "MyPassword" objSession.SignOn()
3
1478
by: chaitanya02 | last post by:
Hi All,, I used this code to send an email to anyone, from my asp page, which accepts email address from the users of the form: Sending a text e-mail using a remote server: <% Set myMail=CreateObject("CDO.Message") myMail.Subject="Sending email with CDO" myMail.From="mymail@mydomain.com"
1
3826
by: TD | last post by:
I have the code below under a button on a form. At this point am just testing how to send email from MS Access. Access is installed on a machine running WinXP Pro. I checked the box next to Microsoft CDO for Windows 2000 under References. I can send one message and then if can close Access no problems. If I click the button several times to send several emails then Access hangs. I have to use task manager to kill it off. Either way,...
6
15057
by: evenlater | last post by:
I'm trying to send an email from an Access procedure using CDO. I've been able to do it successfully with three different sending email addresses, but not with the email address I actually need to use in production. In that case I get a message saying "The transport failed to connect to the server." I've tried several different ports. Anybody have any idea what the problem might be? My code is below. ...
0
8449
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8360
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
8876
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
8784
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7387
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4198
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
4371
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2774
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
1777
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.