2

On my ASP.NET web page, there is a text box called box1, a text box called box2, and a button. When I click on the button, I would like it to automatically create a "Compose a new message " email screen from an already signed in web based email ID such as Yahoo or Gmail. And the recipient(s) and email body text automatically get populated from box1 and box2, respectively, from my ASP.NET web page.

Can this be done?

Thanks.

user523234
  • 14,323
  • 10
  • 62
  • 102

1 Answers1

1
  mailtoLink.href = "https://mail.google.com/mail?view=cm&tf=0" + 
                (emailTo ? ("&to=" + emailTo) : "") + 
                (emailCC ? ("&cc=" + emailCC) : "") +
                (emailSubject ? ("&su=" + emailSubject) : "") +
                (emailBody ? ("&body=" + emailBody) : "");

for yahoo

URI encoding in Yahoo mail compose link

Community
  • 1
  • 1
adt
  • 4,320
  • 5
  • 35
  • 54
  • Don't forget to redirect to this url after you have constructed it. – Tengiz Mar 17 '11 at 10:59
  • Thanks for your reply...I got sidetracked ... Anyway, I did not quite understand the code. But "https://mail.google.com/mail?view=cm&tf=0" gave me idea where to start. I manually compose the link. It worked. However, there seemed to be a limit of the length of the link. So, the email body text is also be limited by using this link redirection. Am I right? – user523234 Mar 26 '11 at 15:53
  • Tengiz, my bad! I was able to compose the url from within my ASP.NET page included all emailto, subject, and body text (with long length message). And was able to bring up the Google mail window and sent away. One problem that I encountered was that Google replace all occurrences of the plus sign (+) with a blank space in my body text message. Any suggestions on how to remedy this would be appreciated. – user523234 Mar 27 '11 at 01:35