Thanks for the answer, but i want it to directly go
to a new message and automaticly insert an email
that i choose and let me write a message and send it.
How can i do that ?
Thanks.
Last edited by 1qaz2wsx7; Aug 13th, 2007 at 6:03 am.
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.
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.
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");
}
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.
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
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.