Forum Topic: Is it possible...

(226 views • 8 replies)

This topic is 1 page long.

<< < > >>
Questioning

boney-man

Reply To Post Reply & Quote

Posted at: 12/19/05 09:28 PM

boney-man DARK LEVEL 08

Sign-Up: 07/24/05

Posts: 318

Is it possible to send the contents of a variable to an email address? Let's say you have the variable 'name', and you want to email its contents to, i dunno, a@a.com. People can type in the variable 'name', and when they hit a button, it places the value of 'name' in an email to a@a.com .

Is this possible? If so, please give me the code. I'm an amateur programmer.

#1286129
Sig by N-Antichrist

BBS Signature

None

Johnny

Reply To Post Reply & Quote

Posted at: 12/19/05 10:23 PM

Johnny DARK LEVEL 20

Sign-Up: 04/17/04

Posts: 3,698

Good question! I think it is possible too, though I'm not sure of the syntax. I'll bump this for you, because I'd like to know too.


None

gorman2001

Reply To Post Reply & Quote

Posted at: 12/19/05 10:29 PM

gorman2001 NEUTRAL LEVEL 14

Sign-Up: 08/18/02

Posts: 1,879

u can do this with PHP.

but u can also do it it a regular html "post form" code, but it is really not effective as the PHP sendmail() method.


None

cook

Reply To Post Reply & Quote

Posted at: 12/19/05 10:40 PM

cook EVIL LEVEL 13

Sign-Up: 03/21/04

Posts: 1,930

You can do it with pretty much any server side language.

Example:

AS:

on(release){
vars = new LoadVars();
vars.mailVar = someVarName;
vars.send("mailvar.php");
}

I think that's how the send method works in LoadVars(), but I don't quite remember.

PHP: mailvar.php

<?

if(!empty($_POST['mailVar'])){
mail("cook@area526.net", "My variable", $_POST['mailVar']);
}

?>

This extremely simple and untested, but you should get the just of it.

Wind 'er Up Bill

BBS Signature

None

cook

Reply To Post Reply & Quote

Posted at: 12/19/05 10:41 PM

cook EVIL LEVEL 13

Sign-Up: 03/21/04

Posts: 1,930

Fuck, I new I'd bungle something up.

Change:
vars.send("mailvar.php");

To:
vars.send("mailvar.php", "POST");

Wind 'er Up Bill

BBS Signature

None

boney-man

Reply To Post Reply & Quote

Posted at: 12/20/05 08:28 PM

boney-man DARK LEVEL 08

Sign-Up: 07/24/05

Posts: 318

At 12/19/05 10:40 PM, -cook- wrote:
PHP: mailvar.php

Yeah, but where do you put the PHP code? Flash certainly doesn't use it.

#1286129
Sig by N-Antichrist

BBS Signature

None

boney-man

Reply To Post Reply & Quote

Posted at: 12/20/05 08:30 PM

boney-man DARK LEVEL 08

Sign-Up: 07/24/05

Posts: 318

I'm a flash programmer, not PHP. I really should learn it though. So where do put the code? I don't have a server to send it to....

#1286129
Sig by N-Antichrist

BBS Signature

None

cook

Reply To Post Reply & Quote

Posted at: 12/20/05 10:00 PM

cook EVIL LEVEL 13

Sign-Up: 03/21/04

Posts: 1,930

You put it in a file, and rename it to PHP. Be sure your host allows PHP or it won't work.

If you need PHP, you could always buy some server space from me. =)

Wind 'er Up Bill

BBS Signature

Questioning

boney-man

Reply To Post Reply & Quote

Posted at: 7/4/06 02:52 PM

boney-man DARK LEVEL 08

Sign-Up: 07/24/05

Posts: 318

Do you think it would work if I put this AS?

on(release){
getURL("mailto:name@something.com?subject=
"+variableOne+"&body="+anotherVar, "_blank");
}

it might....

#1286129
Sig by N-Antichrist

BBS Signature

All times are Eastern Standard Time (GMT -5) | Current Time: 12:17 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!