Results 1 to 2 of 2

Thread: Contact form - hide email info

  1. #1
    Junior Member
    Join Date
    Jun 2011
    Posts
    1

    Cool Contact form - hide email info

    Solution found - several hours of messing about and then I find the solution a few minutes after posting this!!
    So here it is:

    Publish your site with a "from email" and "to email" box on the contact form with no error trapping active and the default text as a few spaces.

    Download ep_sendhtmlmail.php from the scripts directory;
    edit the setheadersandsend function

    change
    $mail->setReturnPath(GetPostVariable('fromField'));
    to
    $mail->setReturnPath("mysendemail@mydomain.com");

    change
    $mail->setFrom('"' . GetPostVariable('fromNameField') . '"' . "<" . GetPostVariable('fromField') . ">");
    to
    $mail->setFrom('"' . GetPostVariable('fromNameField') . '"' . "<" . "mysendemail@mydomain.com" . ">");

    change (2 occurrences of)
    NOF_throwError(201,array("{1}"=>GetPostVariable('t oField'),"{2}"=>GetPostVariable('fromField'),"{3}" =>$conf[$emailCompIdent."emailServer"].":".$conf[$emailCompIdent."emailServerPort"]));
    to
    NOF_throwError(201,array("{1}"=>"myrecvemail@mydomain.com","{2}"=>"mysendemail@mydomain.com","{3}"=>$conf[$emailCompIdent."emailServer"].":".$conf[$emailCompIdent."emailServerPort"]));



    edit the isEmailInvalid function

    change
    $fromEmail = GetPostVariable('fromField');
    to
    $fromEmail = "mysendemail@mydomain.com";

    change
    $toEmails = explode(",",GetPostVariable('toField'));

    $toEmails = explode(",","myrecvemail@mydomain.com");
    then upload it back to the server

    Download the contact page php file (mine is in a "contact_us" directory in the same place as the scripts directory) and edit it
    almost at the bottom of the file find the long line starting "<table><tr><td nowrap><label for='fromField' "

    remove
    <td nowrap><label for='fromField' class='nof_emailPage_label'>From (email)</label></td>
    and
    <td nowrap><label for='toField' class='nof_emailPage_label'>To (email)</label></td>

    change
    type='TEXT' (on both the from field and to field)
    to
    type='hidden'

    Upload that file back to the server

    And just remember that if you re-publish without changing the contact page you can just re-upload them. However if you change and re-publish the contact page you will need to download and edit the new contact php again. (The script should be OK).

    And that was it!!!
    Enjoy




    Original posting ...

    I have created a simple page with an "E-mail Page" component on it

    If I display a From (email) and To (email) field and put email addresses in them it works - it sends an email with the subject, message etc.

    Editing the page HTML to change the fields from TEXT to HIDDEN doesn't help as they have to be pre-populated with the email addresses which are then visible in the HTML code.

    In the scripts folder there is a file EmailPage1400521258062.xml.php which has variables emailFromAddress and emailToAddress which look like I should be able to put the email addresses in, but that has no effect. (Initially coded as to@her.domain.com and from@your.domain.com)

    Similarly I have tried to modify the ep_sendhtmlmail.php file to a constant (e.g. $FromEmail which I set at the start of the program) rather that use GetPostVariable('fromField')

    All with no success.

    I want to be able to set defaults for the from email address, to email address which are not able to be changed and which cannot be retrieved from the html code by robots. (I also want to set the format automatically to plain text - but that is not important!).

    NetObjects support say they cannot help and may pass the request on to their developers - some time.

    This is so fundamental I can't believe it is not included - anyone done this?
    Last edited by RoySharp; 05-22-2014 at 11:51 AM. Reason: Solution found!!

  2. #2
    Senior Member gotFusion's Avatar
    Join Date
    Jan 2010
    Location
    www.gotHosting.biz
    Posts
    4,529

    Default

    Or.....

    You could use mailmunger.

    http://www.gotfusion.com/tutorials/tut.cfm?itemID=4047
    NetObjects Fusion Cloud Linux enabled Web Hosting, support + training starts at $14.95
    NetObjects Fusion web Hosting and support + ASP + PHP + ColdFusion + MySQL + MS SQL
    FREE NetObjects Fusion Support & training comes with all web hosting accounts
    NetObjects Fusion Web Hosting: http://www.gotHosting.biz

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •