Thread: mail function

Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20
  1. #11
    Join Date
    Apr 2008
    Posts
    174
    Plugin Contributions
    0

    Default Re: email a form?

    ok i found a better thing to help me out with.

    this is my new form using the band_signup thanks to Dr Byte
    My Form

    i now have a new error:
    instead of taking what is typed in the email field, it now tries to take what is in the last name field and use it as the email. any help on how to change that?

    old thread

    here is what it says: (by the way, the last name entered is the piohk,j)
    Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\forcemeasurement\includes\functions\functions_email.php on line 387

    Email Error: The following From address failed: piohk,j

  2. #12
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: mail function

    Moderator's note: The 2 threads have been combined into 1.
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #13
    Join Date
    Apr 2008
    Posts
    174
    Plugin Contributions
    0

    Default Re: mail function

    thank you!

  4. #14
    Join Date
    Apr 2008
    Posts
    174
    Plugin Contributions
    0

    Default Re: mail function

    if anyone knows how to help please do. my boss wants to use this asap.

  5. #15
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: mail function

    If it's putting the last name in the email field, then you've done something wrong in your coding whereby either you're passing the wrong parameters to the zen_mail function or you're mixing up values between variables somewhere.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #16
    Join Date
    Apr 2008
    Posts
    174
    Plugin Contributions
    0

    Default Re: mail function

    i'll recheck my code then. if i paste it here, will anyone help me find my mistake?

  7. #17
    Join Date
    Apr 2008
    Posts
    174
    Plugin Contributions
    0

    Default Re: mail function

    i'm pretty sure the error is on this page. i'm confused since it reads correct to me. i must be missing something.

    PHP Code:
    <?php
    //
    // +----------------------------------------------------------------------+
    // |zen-cart Open Source E-commerce                                       |
    // +----------------------------------------------------------------------+
    // | Copyright (c) 2003 The zen-cart developers                           |
    // |                                                                      |
    // | http://www.zen-cart.com/index.php                                    |
    // |                                                                      |
    // | Portions Copyright (c) 2003 osCommerce                               |
    // +----------------------------------------------------------------------+
    // | This source file is subject to version 2.0 of the GPL license,       |
    // | that is bundled with this package in the file LICENSE, and is        |
    // | available through the world-wide-web at the following url:           |
    // | http://www.zen-cart.com/license/2_0.txt.                             |
    // | If you did not receive a copy of the zen-cart license and are unable |
    // | to obtain it through the world-wide-web, please send a note to       |
    // | [email protected] so we can mail you a copy immediately.          |
    // +----------------------------------------------------------------------+
    // $Id: header_php.php,v 1.3 2007/06/07 00:00:00 DrByteZen Exp $
    //
      
    require(DIR_WS_MODULES 'require_languages.php');
      
    $breadcrumb->add(NAVBAR_TITLE);

      
    $error false;
      
    $cemail '';
      
    $company '';
      
    $address '';
      
    $state '';
      
    $city '';
      
    $zip '';
      
    $phone '';
      
    $fax '';
      
    $po '';
      
    $ship '';
      
    $contact_firstname '';
      
    $contact_lastname '';
      
    $idnum '';
      
    $manufacturer '';
      
    $model '';
      
    $serialnum '';
      
    $tolerance '';
      
    $comments '';


      if (isset(
    $_GET['action']) && ($_GET['action'] == 'send')) {
        
    $cemail zen_db_prepare_input($_POST['cemail']);
        
    $company zen_db_prepare_input($_POST['company']);
        
    $address zen_db_prepare_input($_POST['address']);
        
    $state zen_db_prepare_input($_POST['state']);
        
    $city zen_db_prepare_input($_POST['city']);
        
    $zip zen_db_prepare_input($_POST['zip']);
        
    $phone zen_db_prepare_input($_POST['phone']);
        
    $fax zen_db_prepare_input($_POST['fax']);
        
    $po zen_db_prepare_input($_POST['po']);
        
    $ship zen_db_prepare_input($_POST['ship']);
        
    $contact_firstname zen_db_prepare_input($_POST['contact_firstname']);
        
    $contact_lastname zen_db_prepare_input($_POST['contact_lastname']);
        
    $idnum zen_db_prepare_input($_POST['idnum']);
        
    $manufacturer zen_db_prepare_input($_POST['manufacturer']);
        
    $model zen_db_prepare_input($_POST['model']);
        
    $serialnum zen_db_prepare_input($_POST['serialnum']);
        
    $tolerance zen_db_prepare_input($_POST['toelrance']);
        
    $comments zen_db_prepare_input(strip_tags($_POST['comments']));

        if (!
    zen_validate_email($cemail))  {
          
    $error true;
          
    $messageStack->add('repair_form'ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
          }
        if (!
    zen_not_null($cemail))  {
          
    $error true;
          
    $messageStack->add('repair_form''Please fill in the email');
          }
        if (!
    zen_not_null($address))  {
          
    $error true;
          
    $messageStack->add('repair_form''Please fill in the address');
          }
        if (!
    zen_not_null($state))  {
          
    $error true;
          
    $messageStack->add('repair_form''Please fill in the state');
          }
        if (!
    zen_not_null($city))  {
          
    $error true;
          
    $messageStack->add('repair_form''Please fill in the city');
          }
        if (!
    zen_not_null($phone))  {
          
    $error true;
          
    $messageStack->add('repair_form''Please fill in the phone');
          }
        if (!
    zen_not_null($fax))  {
          
    $error true;
          
    $messageStack->add('repair_form''Please fill in the fax');
          }
        if (!
    zen_not_null($contact_firstname))  {
          
    $error true;
          
    $messageStack->add('repair_form''Please fill in the Contact First Name');
          }
        if (!
    zen_not_null($contact_lastname))  {
          
    $error true;
          
    $messageStack->add('repair_form''Please fill in the Contact Last Name');
          }
        if (!isset(
    $_POST['certificate']) || ($_POST['certificate'] != '1')) {
          
    $error true;
          
    $messageStack->add_session('repair_form''You must choose a certificate level.''error');
        }

       if (
    $error == false) {

    // grab some customer info if logged in
          
    if(isset($_SESSION['customer_id'])) {
            
    $check_customer $db->Execute("select customers_firstname, customers_lastname, customers_email_address
            from " 
    TABLE_CUSTOMERS " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");
            
    $customer_email $check_customer->fields['customers_email_address'];
            
    $customer_name $check_customer->fields['customers_firstname'] . ' ' $check_customer->
            
    fields['customers_lastname'];
          } else {
            
    $customer_email 'Not logged in';
            
    $customer_name 'Not logged in';
          }

    //assemble the email contents:
          
    $email_text 'Repair Form Submission: ' "\n" .
            
    '------------------------------------------------------' "\n" .
            
    'cemail:' "\t" $cemail "\n" .
            
    'address:' "\t" $address "\n" .
            
    'state:' "\t" $state "\n" .
            
    'city:' "\t" $city "\n" .
            
    'zip:' "\t" $zip "\n" .
            
    'contact_firstname:' "\t" $contact_firstname "\n" .
            
    'contact_lastname:' "\t" $contact_lastname "\n" .
            
    'phone:' "\t" $phone "\n" .
            
    'fax:' "\t" $fax "\n" .
            
    'po:' "\t" $po "\n" .
            
    'ship:' "\t" $ship "\n" .
            
    'manufacturer:' "\t" $manufacturer "\n" .
            
    'model:' "\t" $model "\n" .
            
    'serialnum:' "\t" $serialnum "\n" .
            
    'idnum:' "\t" $idnum "\n" .
            
    'calibrate:' "\t" $calibrate "\n" .
            
    'tolerance:' "\t" $tolerance "\n" .
            
    'certificate:' "\t" $certificate "\n" .
            
    'comments:' "\t" $comments "\n\n" .
            
    '------------------------------------------------------' "\n" .
            
    OFFICE_USE "\t" "\n" .
            
    OFFICE_LOGIN_NAME "\t" $customer_name "\n" .
            
    OFFICE_LOGIN_EMAIL "\t" $customer_email "\n" .
            
    OFFICE_IP_ADDRESS "\t" $_SERVER['REMOTE_ADDR'] . "\n" .
            
    OFFICE_HOST_ADDRESS "\t" gethostbyaddr($_SERVER['REMOTE_ADDR']) . "\n" .
            
    OFFICE_DATE_TIME "\t" date("D M j Y G:i:s T") . "\n" .
            
    '------------------------------------------------------' "\n\n" .
          
    $email_text zen_output_string_protected($email_text);
          
    $email_html nl2br("\n" $email_text);

    //send the email
          
    zen_mail(STORE_NAMESEND_TO_ADDRESSEMAIL_SUBJECT$email_text,
          
    $contact_firstname$contact_lastname$cemail, array('EMAIL_MESSAGE_HTML' => $email_html),
          
    'repair_form');

          
    zen_redirect(zen_href_link(FILENAME_repair_form'action=success'));
          } 
    //endif $error=false

      
    // endif action

    // default email and name if customer is logged in
      
    if(isset($_SESSION['customer_id'])) {
          
    $check_customer $db->Execute("select customers_firstname, customers_lastname, customers_email_address
          from " 
    TABLE_CUSTOMERS " where customers_id = '" $_SESSION['customer_id'] . "'");
          if (
    $cemail == ''$cemail $check_customer->fields['customers_email_address'];
          if (
    $contact_firstname == ''$contact_firstname $check_customer->fields['customers_firstname'];
          if (
    $contact_lastname == ''$contact_lastname $check_customer->fields['customers_lastname'];
      }

    ?>

    The Form

  8. #18
    Join Date
    Apr 2008
    Posts
    174
    Plugin Contributions
    0

    Default Re: mail function

    can anyone help? its really getting frustrating now.

  9. #19
    Join Date
    Apr 2008
    Posts
    174
    Plugin Contributions
    0

    Default Re: mail function

    no need for anyone to post. i got it on my own

  10. #20
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: mail function

    Glad you got it sorted out. Sometimes it can feel like a needle in a haystack when there's so many fields and parameters to work with
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Replies: 0
    Last Post: 6 Aug 2011, 08:12 PM
  2. E-Mail Function Errors
    By Yizit in forum General Questions
    Replies: 14
    Last Post: 22 May 2006, 08:05 PM

Posting Permissions

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