Announcement

Collapse
No announcement yet.

Want to add a string to the email address field help please

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Want to add a string to the email address field help please

    Hey guys,
    I'm trying to modify the mailform.pl in order to add "@domain.com" to my Email address field in CONTACT US that is submitted to STMP server.
    Problem is that my host will only accept emails if the domain is from my site.
    I am trying to combine what the user inputs in the mail field and to add "@domain.com" to the final variable that is sent to the host STMP.

    If anyone with programming knowledge knows how to combine variables in pearl please let me know either in the input or in the pearl script.
    I tested this parameter out but it did not work. I do not think u can combine a variable and a string in pearl.
    $sEmailRecpt = $::g_InputHash{'EmailAddress'} . "@domain.com";

    If it is possible to capture the email address then add to it a different ending from the HTML coding than that would also work ...

    This is the HTML I am refering too:
    </td><td><span class="actrequired">Email Address: *</span></td><td><input type="text" name="EmailAddress" size="50" value="NETQUOTEVAR:EMAILVALUE" /> </td></tr><tr> <td valign="top">

    Would really aprechiate your help.

    #2
    You'd end up with addresses like joecustomer@joesplace.com@mydomain.com which isn't a valid address.
    Better move the customers email into the Subject field.

    E.g. Replace:
    Code:
    sub SendMailToMerchant
    	{
    	#
    	# Receive parameters from input hash
    	#
    	my ($sEmailRecpt, $sSubject, $sTextMailBody, $sName, $sMessage, $sHTML);
    	$sEmailRecpt 	= $::g_InputHash{'EmailAddress'};
    	$sSubject 		= $::g_InputHash{'Subject'};
    	$sName 			= $::g_InputHash{'Name'};
    	$sMessage 		= $::g_InputHash{'Message'};
    with

    Code:
    sub SendMailToMerchant
    	{
    	#
    	# Receive parameters from input hash
    	#
    	my ($sEmailRecpt, $sSubject, $sTextMailBody, $sName, $sMessage, $sHTML);
    	$sEmailRecpt 	= 'contact@mysite.com';
    	$sSubject 		= $::g_InputHash{'Subject'} . ' FROM: ' . $::g_InputHash{'EmailAddress'};
    	$sName 			= $::g_InputHash{'Name'};
    	$sMessage 		= $::g_InputHash{'Message'};
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Perfect it works

      Thank you Norman. Tried it out and it works like a charm.
      whith this joecustomer@joesplace.com@mydomain.com it also works does not give me any invalid address error...
      thanks again

      Comment

      Working...
      X