views:

189

answers:

2

Hi guys I found out that in order to open a GMAIL compose screen you'd have to be logged in and open the following link:

https://mail.google.com/a/domain/?view=cm&fs=1&tf=1&source=mailto&to=WHOEVER%40COMPANY.COM&su=SUBJECTHERE&cc=WHOEVER%40COMPANY.COM&bcc=WHOEVER%40COMPANY.COM&body=PREPOPULATEDBODY

Replacing the variables fills in the corresponding places on the compose form. However if I want to enter into the body multiline text or line breaks its just not working even if I urlencode it. Any ideas here?

+1  A: 

Check that your UrlEncode method really translates newlines into "%0a". Here's an example of a 2-line email body:

https://mail.google.com/mail/?view=cm&ui=2&tf=0&fs=1&to=WHOEVER%40COMPANY.COM&su=SUBJECTHERE&body=LINE1%0aLINE2

Anthony Faull
Thanks that solved it great but now Im having another issue with too much text - http://stackoverflow.com/questions/2590467/prefilling-large-volumes-of-body-text-in-gmail-compose-getting-a-request-uri-too
Ali
A: 

I used standard javascript encodeURIComponent() for encoding multiline body. It worked.

Also those who want to prepopulate generic gmail and not app domain specific account, use this URL instead:

https://mail.google.com/?view=cm&fs=1&tf=1&....

Jayesh