Jump to content

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


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 = "me@domain.com";

$subject = $_GET['med'];

 

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

 

 

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.