Jump to content

[SOLVED] Sending an email with the value of a variable in the subject line


kiowa_jackson

Recommended Posts

I have a web form I use to capture leads

 

<form action="https://rws.infusionsoft.com/AddForms/processForm.jsp" method='POST'>
<input type="hidden" id="formid" name="formid" value="6">
<input type="hidden" id="type" name="type" value="CustomFormWeb">
<input type='hidden' name='med' value='ppc'>
<table>
<tr><td colspan=99 style="padding:4px;background-color:#000000;color:#FFFFFF">Contact Information</td></tr>
	<tr><td>First Name</td><td><input type='text' name='Contact0FirstName' value=''></td></tr>
	<tr><td>Email</td><td><input type='text' name='Contact0Email' value=''></td></tr>
<tr><td colspan=2><input title="" type="submit" name="Submit" id="Submit" value="Submit" class="button np"></td></tr>
</table>
</form>

 

Is it possible to also make it send an email with the value of a specific variable in the subject line?

 

So if someone finds the form with

 

http://www.myurl.com/form.php?med=ppc

 

Then an email gets sent with the subject line "ppc" (i.e. value of $med) to my email address.

 

Thanks

Sure can if you want to use PHP instead of JSP

 

$to = "[email protected]";

$subject = $_GET['med'];

 

mail ($to, $subject, $body, $header);

 

 

Fill out $body and $header as required and make sure you sanitize the $_GET variable.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.