I want users to be able to send an email to an address they supply. In a text entry field (variable=email) they submit an address. But when they click on the button to send the email, an email addressed to email opens.
var request:URLRequest = new URLRequest("mailto:name@hotmail.com"+"?subject=Subject"+"&body= Hello world ");
navigateToURL(request, "_blank");
request.method = URLRequestMethod.POST;
Last edited by rynoe; 06-07-2012 at 03:36 PM.
Reason: monkey stole my sock
however, this produces the error "command line arguments are not valid. verify switches"
Research seems to indicate that is an Outlook problem. I was wondering if something was wrong with my syntax. That's why I started tinkering with the placement of the quotation marks (obviously not a brilliant move).
If this is an Outlook problem, will all my audience members (the majority of whom are also running Office 2007 on Windows 7) also experience this? Or is my system "special"?
Is this something that can be addressed though AS code? (and BTW, AS3 hurts my head)
Zip up the fla. Reply to thread, scroll down a bit to the 'Manage Attachments' button and click it. From there you attach a document like most other types of apps.
however, this produces the error "command line arguments are not valid. verify switches"
That's coming from Outlook. When the mailto: protocol is invoked, Windows looks at the registry entry HKEY_CLASSES_ROOT\mailto\shell\open\command for the command-line. On my computer it is
The %1 is where the text after the mailto: goes. If you plug in a regular e-mail address in the format of user@host.com, it works fine. Things start to get screwy when you try put in double quotation marks. Usually this happens when people want to populate the subject field:
mailto:user@host.com?subject=Comments about "The Play"
The " in terminates the command-line argument prematurely, causing the Windows to interpret what follows as additional commands to Outlook. Hence an invalid arguments error.
The rub is that there is no way to escape the quotation marks. All you can do is remove them. The Windows command-line shell is also not Unicode-aware. Any non-Ascii character will end up as question marks.
Anyway, in you case, the problem is that the textbox is setting the variable to HTML. Instead of mailto:user@host.com, what you're sending to getUrl() is actually mailto:<p align="left">user@host.com</p>. The quotation marks in the tag in turn is causing Outlook to barf. To fix it, give the textbox an instance name and get the text through _parent.[instance].text or _root.[instance] or something like that, depending on where the text field is.
That's coming from Outlook. When the mailto: protocol is invoked, Windows looks at the registry entry HKEY_CLASSES_ROOT\mailto\shell\open\command for the command-line. On my computer it is
The %1 is where the text after the mailto: goes. If you plug in a regular e-mail address in the format of user@host.com, it works fine. Things start to get screwy when you try put in double quotation marks. Usually this happens when people want to populate the subject field:
The " in terminates the command-line argument prematurely, causing the Windows to interpret what follows as additional commands to Outlook. Hence an invalid arguments error.
The rub is that there is no way to escape the quotation marks. All you can do is remove them. The Windows command-line shell is also not Unicode-aware. Any non-Ascii character will end up as question marks.
Anyway, in you case, the problem is that the textbox is setting the variable to HTML. Instead of mailto:user@host.com, what you're sending to getUrl() is actually mailto:<p align="left">user@host.com</p>. The quotation marks in the tag in turn is causing Outlook to barf. To fix it, give the textbox an instance name and get the text through _parent.[instance].text or _root.[instance] or something like that, depending on where the text field is.
Thank you thank you thank you--i saw that when I checked the variables and wondered if that was posing a problem!
on (release) {
getURL("mailto:"+MentorsEmail.text);
}
help again! now that that's working, I want the subject and body to be populated, as well. Starting with the subject,
on (release) {
getURL("mailto:"+MentorsEmail.text"?subject=:"+you rName.text);
}
should work, but it doesn't
you also put a ":" infront of the subject line. thats completely fine. but its kind of wierd to have it as the first character of your subject line. so i removed it.