473,583 Members | 4,510 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Send To Mail Recipient"

cj
How can I get a button in VB to send the contents of a text box via
email in a manner similar to the "Send To\Mail Recipient" functionality
that you can select via right clicking a file in Windows Explorer?

I want the user to click a button and it lunch the users default email
client and put the contents of a multi line text box in the body of the
message and the contents of another text box in the title box and be
sitting there read for them to type the recipient's name and hit send.
I assume this is easily doable but I don't know where to begin.
Apr 25 '06 #1
15 8582
Here's an example:
http://www.ostrosoft.com/smtp_component/smtp_vbnet.asp

"cj" <cj@nospam.nosp am> wrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
How can I get a button in VB to send the contents of a text box via email in a
manner similar to the "Send To\Mail Recipient" functionality that you can
select via right clicking a file in Windows Explorer?

I want the user to click a button and it lunch the users default email client
and put the contents of a multi line text box in the body of the message and
the contents of another text box in the title box and be sitting there read
for them to type the recipient's name and hit send. I assume this is easily
doable but I don't know where to begin.

Apr 25 '06 #2
cj
That actually sends the email. That's impressive, but I just wanted to
launch the default email program, create a new message and fill in the
subject and add some text to the message body. Leave it for the person
to review, change and send.
Mike Lowery wrote:
Here's an example:
http://www.ostrosoft.com/smtp_component/smtp_vbnet.asp

"cj" <cj@nospam.nosp am> wrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
How can I get a button in VB to send the contents of a text box via email in a
manner similar to the "Send To\Mail Recipient" functionality that you can
select via right clicking a file in Windows Explorer?

I want the user to click a button and it lunch the users default email client
and put the contents of a multi line text box in the body of the message and
the contents of another text box in the title box and be sitting there read
for them to type the recipient's name and hit send. I assume this is easily
doable but I don't know where to begin.


Apr 25 '06 #3
CMM
AKAIK, the easiest way to do this is using the classic MAPI32 ActiveX
controls... yes it works with whatever e-mail is the default (both Outlook
and OE and any E-mail client that follows Windows Standards)... and you can
use it from .NET.

http://activex.microsoft.com/controls/vb6/MSMAPI32.CAB

Not sure if .NET 2.0 has the feature built-in.... but there should be no
shame in using COM components in .NET if there no .NET alternative....
Visual Studio IDE itself is a BIG *COM* application.

Example that I think does what you ask once you add a reference to
MSMAPI32.OCX:

MAPISession1.Do wnLoadMail = False
MAPISession1.Si gnOn
MAPISession1.Ne wSession = True

MAPIMessages1.S essionID = MAPISession1.Se ssionID

MAPIMessages1.C ompose
MAPIMessages1.R ecipAddress = "so*****@somewh ere.com"
MAPIMessages1.m sgSubject = "My subject"
MAPIMessages1.m sgNoteText = "bla bla bla"

'leave this out to keep the window open
MAPIMessages1.S end

MAPISession1.Si gnOff
MAPISession1.Ne wSession = False
--
-C. Moya
www.cmoya.com
"cj" <cj@nospam.nosp am> wrote in message
news:uN******** *****@TK2MSFTNG P03.phx.gbl...
That actually sends the email. That's impressive, but I just wanted to
launch the default email program, create a new message and fill in the
subject and add some text to the message body. Leave it for the person to
review, change and send.
Mike Lowery wrote:
Here's an example:
http://www.ostrosoft.com/smtp_component/smtp_vbnet.asp

"cj" <cj@nospam.nosp am> wrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
How can I get a button in VB to send the contents of a text box via
email in a manner similar to the "Send To\Mail Recipient" functionality
that you can select via right clicking a file in Windows Explorer?

I want the user to click a button and it lunch the users default email
client and put the contents of a multi line text box in the body of the
message and the contents of another text box in the title box and be
sitting there read for them to type the recipient's name and hit send. I
assume this is easily doable but I don't know where to begin.


Apr 26 '06 #4
http://www.systemwebmail.com/faq/2.aspx

Or probably just easier to use:

System.Diagnost ics.Process.Sta rt("mailto:" & txtEmail & "?Subject=" &
txtSubject" & "?Body=" & txtBody )

Apr 26 '06 #5
CMM
I don't think the "body" parameter of mailto: is standard... not sure if its
consistently implemented by all e-mail clients. I would hope in today's day
and age they all do.

P.S.
System.Web.Mail is deprecated in .NET 2.0. For 2.0 users, the link should
be:
http://www.systemnetmail.com/ But in any case, the OP wants to trigger the
default E-mail program not worry about SMTP servers and stuff like that.

--
-C. Moya
www.cmoya.com
"Aziz" <az*****@google mail.com> wrote in message
news:11******** **************@ i40g2000cwc.goo glegroups.com.. .
http://www.systemwebmail.com/faq/2.aspx

Or probably just easier to use:

System.Diagnost ics.Process.Sta rt("mailto:" & txtEmail & "?Subject=" &
txtSubject" & "?Body=" & txtBody )

Apr 26 '06 #6
cj
Just got time to try the suggestions I got.

Aziz, this is a great way of launching the email client!

CMM, apparently body isn't standard in Mozilla Thunderbird anyway. I'll
have to try it under Outlook.

Really would like for it to handle both. Any other info anyone can
provide would be appreciated. I'm going to search the web for awhile
and see what I can come up with.
CMM wrote:
I don't think the "body" parameter of mailto: is standard... not sure if its
consistently implemented by all e-mail clients. I would hope in today's day
and age they all do.

P.S.
System.Web.Mail is deprecated in .NET 2.0. For 2.0 users, the link should
be:
http://www.systemnetmail.com/ But in any case, the OP wants to trigger the
default E-mail program not worry about SMTP servers and stuff like that.

Apr 28 '06 #7
cj
That didn't take long. I still need to try it in Outlook but in
Thunderbird change ?body to &body and it works!

cj wrote:
Just got time to try the suggestions I got.

Aziz, this is a great way of launching the email client!

CMM, apparently body isn't standard in Mozilla Thunderbird anyway. I'll
have to try it under Outlook.

Really would like for it to handle both. Any other info anyone can
provide would be appreciated. I'm going to search the web for awhile
and see what I can come up with.
CMM wrote:
I don't think the "body" parameter of mailto: is standard... not sure
if its consistently implemented by all e-mail clients. I would hope in
today's day and age they all do.

P.S.
System.Web.Mail is deprecated in .NET 2.0. For 2.0 users, the link
should be:
http://www.systemnetmail.com/ But in any case, the OP wants to trigger
the default E-mail program not worry about SMTP servers and stuff like
that.

Apr 28 '06 #8
cj
CMM, I have it sending a message but I can't get it to start a message
and leave it on the screen. The messages never show on the screen.

I also have been trying to figure out what the heck is going on with it
now as unlike "send to"/"mail recipient" this triggers Thunderbird to
tell me another application is trying to send mail from me.

I even had a problem to start with that my program launched internet
connection wizard to set up a new email account when I have two seperate
pop3 email accounts one in Thunderbird and one in Outlook which have
both been working for a year now. Thunderbird is default. I honestly
don't know why it disapeared but it did after I ran a program I
downloaded that was supposed to set different email programs as default.

CMM wrote:
AKAIK, the easiest way to do this is using the classic MAPI32 ActiveX
controls... yes it works with whatever e-mail is the default (both Outlook
and OE and any E-mail client that follows Windows Standards)... and you can
use it from .NET.

http://activex.microsoft.com/controls/vb6/MSMAPI32.CAB

Not sure if .NET 2.0 has the feature built-in.... but there should be no
shame in using COM components in .NET if there no .NET alternative....
Visual Studio IDE itself is a BIG *COM* application.

Example that I think does what you ask once you add a reference to
MSMAPI32.OCX:

MAPISession1.Do wnLoadMail = False
MAPISession1.Si gnOn
MAPISession1.Ne wSession = True

MAPIMessages1.S essionID = MAPISession1.Se ssionID

MAPIMessages1.C ompose
MAPIMessages1.R ecipAddress = "so*****@somewh ere.com"
MAPIMessages1.m sgSubject = "My subject"
MAPIMessages1.m sgNoteText = "bla bla bla"

'leave this out to keep the window open
MAPIMessages1.S end

MAPISession1.Si gnOff
MAPISession1.Ne wSession = False

May 2 '06 #9
CMM
MAPIMessages1.S end(True)
Should display the compose window.

--
-C. Moya
www.cmoya.com
"cj" <cj@nospam.nosp am> wrote in message
news:ej******** ******@TK2MSFTN GP03.phx.gbl...
CMM, I have it sending a message but I can't get it to start a message
and leave it on the screen. The messages never show on the screen.

I also have been trying to figure out what the heck is going on with it
now as unlike "send to"/"mail recipient" this triggers Thunderbird to tell
me another application is trying to send mail from me.

I even had a problem to start with that my program launched internet
connection wizard to set up a new email account when I have two seperate
pop3 email accounts one in Thunderbird and one in Outlook which have both
been working for a year now. Thunderbird is default. I honestly don't
know why it disapeared but it did after I ran a program I downloaded that
was supposed to set different email programs as default.

CMM wrote:
AKAIK, the easiest way to do this is using the classic MAPI32 ActiveX
controls... yes it works with whatever e-mail is the default (both
Outlook and OE and any E-mail client that follows Windows Standards)...
and you can use it from .NET.

http://activex.microsoft.com/controls/vb6/MSMAPI32.CAB

Not sure if .NET 2.0 has the feature built-in.... but there should be no
shame in using COM components in .NET if there no .NET alternative....
Visual Studio IDE itself is a BIG *COM* application.

Example that I think does what you ask once you add a reference to
MSMAPI32.OCX:

MAPISession1.Do wnLoadMail = False
MAPISession1.Si gnOn
MAPISession1.Ne wSession = True

MAPIMessages1.S essionID = MAPISession1.Se ssionID

MAPIMessages1.C ompose
MAPIMessages1.R ecipAddress = "so*****@somewh ere.com"
MAPIMessages1.m sgSubject = "My subject"
MAPIMessages1.m sgNoteText = "bla bla bla"

'leave this out to keep the window open
MAPIMessages1.S end

MAPISession1.Si gnOff
MAPISession1.Ne wSession = False


May 2 '06 #10

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

Similar topics

14
22582
by: OldGuy | last post by:
Hi All Sendmail 8.12.11 php 4.3.9 Sendmail is installed and works properly. php is NOT in safemode from the command line; mail user@domain.com < testmsg works fine.
3
3342
by: Erik T. Nomad | last post by:
I've created a link that will enable the reader of any page on my website to click it, enter an e-mail address, and have it arrive in that inbox with a hyperlink to the site. However, I'm wondering if there's a way to customize it further, such that the hyperlink they are sent is the web address of the page the "send to friend" link was on. ...
2
1378
by: Jason Steeves | last post by:
I need to be able to emulate what IE does when you select file->send->page by e-mail. Does anyone know the code to replicate this. I would like to program a submit button that will create a new e-mail for my users and attach the current form as an htm file. Thanks for you replies.
1
1555
by: lauren quantrell | last post by:
If there a way to call the toolbar command "Mail Recipient (as attachment)..." using VBA? Thanks, lq
3
2664
by: Greg Arnold | last post by:
I have created a "Send To" application that allows users to rename files. The user selects files in Windows Explorer, right clicks and selects Send To > File Renamer. The problem is when a large number of files are selected, the app gives an error that says "Windows cannot access the specified device, path or file". I am currently testing...
1
2279
by: stax | last post by:
Hello, I would like to add a Send Feedback feature to my application. Does anybody know or easy way to do this, any applications that do this, articles, samples or anything else that could give me some hints. I tried to look how Reflector implements this but couldn't find anything. I'm using .NET 2.0, there is a class called SmtpClient, can...
2
2399
by: chuckdfoster | last post by:
I am getting a "Could Not Access CDO.Message Object" Error when I try to use the following code to send an email via ASP.NET. When I run this on one machine it works, on another one it doesn't. Both have VS.NET installed and both have MS Outlook installed. What do I need done to the machine that doesn't work? Or is something wrong with the...
0
1581
by: Quisbamsis | last post by:
Access Database Merge to Publisher or Word. Everytime I run a "Mail and Catalogue Merge Wizard" in Publisher or Word and I get to the "Mail Merge Recipients" dialogue box, my edit button is deselected, and I can't make any edits to the selected Access database. I have to close out of Publisher, and launch my Access database with the...
3
10620
by: Evan | last post by:
Hello - I'm new with Python, I try to do a mail problem, the code likes below: +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ import smtplib import mimetypes from email.Encoders import encode_base64 from email.MIMEAudio import MIMEAudio
0
7894
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...
0
7825
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...
0
8179
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. ...
1
7933
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6578
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...
0
3841
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2331
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
1
1431
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1155
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...

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.