•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 402,519 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,718 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser: Programming Forums
Views: 5180 | Replies: 8
![]() |
If by mail box you mean an email application like outlook, you can use the Process class from System.Diagnostics.
C# Syntax (Toggle Plain Text)
System.Diagnostics.Process.Start( "outlook.exe" );
The truth does not change according to our ability to stomach it.
I'm not sure you can do that with outlook, but I'd start by seeing if there's a command line switch I could use. Something like
You're probably asking too much for a simple solution and the best way to solve the problem would be to write your own mail handler instead of calling an existing one.
c# Syntax (Toggle Plain Text)
System.Diagnostics.Process.Start( "outlook.exe /newmessage" );
The truth does not change according to our ability to stomach it.
You might want to try the HTML mailto syntax.
For example: <a href="mailto:email@test.com?body=I am having trouble finding information on... ">email me></a>
Clicking on the above link will open your default email handler with message already started in Body. (Check this page for more examples http://www.ianr.unl.edu/internet/mailto.html)
Now you have to see how to integrate HTML into your application.
Good luck.
For example: <a href="mailto:email@test.com?body=I am having trouble finding information on... ">email me></a>
Clicking on the above link will open your default email handler with message already started in Body. (Check this page for more examples http://www.ianr.unl.edu/internet/mailto.html)
Now you have to see how to integrate HTML into your application.
Good luck.
•
•
Join Date: Oct 2007
Posts: 92
Reputation:
Rep Power: 1
Solved Threads: 8
I give u a brief peace of code
First u must include
using System.Net.Mail;
//Initialize an SMTP client
SmtpClient objSmtpClient = new SmtpClient();
MailMessage objMail = new MailMessage();
// Precise the mail adress sender and reciever
MailAdress oSenderAdress = new MailAdress("dsd@dsdd.fd");
MailAdress oRecieverAdress = new MailAdress("sdsd@dsdsd.fd");
//Parameter the objMail
objMail.From = oSenderAdress;
objMail.To = oRecieverAdress;
//To send the email u can use the method
try{
objSmtpClient.send(objMail);
}
catch(Exception caught)
{ Response.Redirect("http://www.yourWebSite/ErrorPage.asp");
}
First u must include
using System.Net.Mail;
//Initialize an SMTP client
SmtpClient objSmtpClient = new SmtpClient();
MailMessage objMail = new MailMessage();
// Precise the mail adress sender and reciever
MailAdress oSenderAdress = new MailAdress("dsd@dsdd.fd");
MailAdress oRecieverAdress = new MailAdress("sdsd@dsdsd.fd");
//Parameter the objMail
objMail.From = oSenderAdress;
objMail.To = oRecieverAdress;
//To send the email u can use the method
try{
objSmtpClient.send(objMail);
}
catch(Exception caught)
{ Response.Redirect("http://www.yourWebSite/ErrorPage.asp");
}
•
•
Join Date: Apr 2006
Posts: 87
Reputation:
Rep Power: 3
Solved Threads: 2
I have actually seen what 1qaz2wsx7 is talking about. It's actually pretty cool. I first saw it at work when a end user needed some help. She was using a Access DB that on one of the forms would actually open up Lotus Notes and fill in the Recipient, Subject and Body.
On a windows machines it uses the default email program that I think can be set int Internet Options -> Programs-> Email setting.
My 2 Cents
On a windows machines it uses the default email program that I think can be set int Internet Options -> Programs-> Email setting.
My 2 Cents
•
•
Join Date: Feb 2007
Location: St. Vincent and the Grenadines, Caribbean
Posts: 961
Reputation:
Rep Power: 3
Solved Threads: 39
WOw this is an old thread, but it is possible to launch the default email program with a new message window wih this code:
the when Windows sees the mailto protocol it opens the associated program. The program will open a new message page only (Well that's what Windows Mail and Outlook did on my Vista system). You can change the mailto arguments. See: http://www.ianr.unl.edu/internet/mailto.html
C# Syntax (Toggle Plain Text)
System.Diagnostics.Process.Start("mailto:foo@bar.info");
Half and a half meck a whole, and I donned it a hundrid purcent
![]() |
•
•
•
•
•
•
•
•
DaniWeb C# Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Can't send email (Windows NT / 2000 / XP / 2003)
- unable to upload files or send email on wireless (Windows NT / 2000 / XP / 2003)
- Cannot Upload files or send email on wireless (Web Browsers)
- Using PHP to Send Email to a single DB list member every 24 hrs. (PHP)
- Batch file to send email!! (Windows NT / 2000 / XP / 2003)
- Not able to send email by "MAIL" (OS X)
- can not send email and cannot send file through instant messaging (Windows NT / 2000 / XP / 2003)
Other Threads in the C# Forum
- Previous Thread: Replaceing Text In A File
- Next Thread: findcontrol in datatable




Linear Mode