473,382 Members | 1,651 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

.NET equivalent of html 'mailto ?

I have a small light-weight winform app (C# .NET 2.0) that does some
web-scraping and, under certain conditions, needs to send a plain-text
e-mail.

This is simple for mail servers that don't require authentication, but my
own mail server (GoDaddy) does, and I want it to work with such servers.

What I want is for the application to invoke the default mail handler on the
user's machine exactly as using the 'mailto facility in HTML will.

And I don't want to have to build in username/password entry fields that
will add a real security burden.

I've looked at all the smtpmail and mailmessage code on CodeProject, hunted
through the MS newsgroups, and I am assuming right now this cannot be done
for security reasons.

But I wonder if some kind of "hack" like putting a WebBrowser control in and
trying to use 'mailto on a composed link in its hidden HTML might work.

Outlook automation would be another avenue of approach, but I'd like to stay
away from being locked into that application being present.

Appreciate any suggestions !

Bill
Feb 20 '06 #1
3 13468
I should have noted that the solution I am looking for is not exactly like
invoking 'mailto from HTML.

You can, indeed, easily invoke 'mailto on a linklabel in .NET by using

// mailToURL : string in typical mailto HTML format
System.Diagnostics.Process.Start(mailToURL);

And this will fire up your default mail client with a structured message.

But it won't send the message which means unattended use is out.

I need something that will send the message from the default e-mail client,
as well as invoking it.

thanks, Bill

Feb 20 '06 #2
Bill,
unfortunately, this is not as easy as it may seem, since some machines may
have Outlook, and others only Outlook Express, which does not expose a
programmable COM interface.
Your best bet is to use the System.Net.Mail namespace.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Bill Woodruff" wrote:
I have a small light-weight winform app (C# .NET 2.0) that does some
web-scraping and, under certain conditions, needs to send a plain-text
e-mail.

This is simple for mail servers that don't require authentication, but my
own mail server (GoDaddy) does, and I want it to work with such servers.

What I want is for the application to invoke the default mail handler on the
user's machine exactly as using the 'mailto facility in HTML will.

And I don't want to have to build in username/password entry fields that
will add a real security burden.

I've looked at all the smtpmail and mailmessage code on CodeProject, hunted
through the MS newsgroups, and I am assuming right now this cannot be done
for security reasons.

But I wonder if some kind of "hack" like putting a WebBrowser control in and
trying to use 'mailto on a composed link in its hidden HTML might work.

Outlook automation would be another avenue of approach, but I'd like to stay
away from being locked into that application being present.

Appreciate any suggestions !

Bill

Feb 20 '06 #3
You can always use launch the default mail client via the registry -
the MAPI setting is stored in the registry:

HKCU\SOFTWARE\Clients\Mail\

Holds all the mail clients

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\mailto\shell\o pen\command

holds the default client in the (Default) key

Feb 20 '06 #4

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

Similar topics

4
by: Ann | last post by:
Hi, I am trying to send a html email from a php script. This script emails a common information to all the members in the database. The only problem is I cannot specify colors, hyperlinks...
6
by: Jerry Werner | last post by:
I need to replace my email address on hundreds of web pages with a new address (in a graphic, not a mailto) in order to thwart the email harvesters that spammers are using. Ideally, I'd like to do...
3
by: Grumble | last post by:
Hello all, Is there an iostream equivalent to cstdio's popen()? Is there a way to change a FILE * into an iostream?
2
by: Joe W Larson | last post by:
I've been up and down trying to figure this one out with no luck. Is it possible to have a mailto link or some other way with Javascript that can send the HTML content of the current page or of an...
3
by: rvanvolken | last post by:
After sending an email message formatted for HTML using the STMP Mail function within .NET, my message arrives with exclamation marks throughout the text, which inadvertantly hinders the correct...
6
by: Paolo Pignatelli | last post by:
I have an aspx code behind page that goes something like this in the HTML view: <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%#"mailto:" &amp;...
6
by: Christopher Glenn | last post by:
I have very basic html skills. My friend who has a wide screen monitor and is using IE7 sent me a jpg screen shot of my home page. I have attached this jpg, but I recall a while back that...
2
by: =?Utf-8?B?Q2FwdGFpbiBEYXZlIQ==?= | last post by:
I wrote some code to send an email with two alternate views: 1) html 2) plain text All the html enabled email clients accept the html just fine and disregard the plain text version. However,...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.