Sender email address

Discussion in 'Technical Support' started by ag1266, Dec 17, 2011.

  1. ag1266 Customer

    What version of 68 Classifieds are you running?
    v4.2.4 Developer

    What template are you using?
    Modified Default

    Please describe in detail the issue you are having:

    I'm using a 3rd party SMTP service for the sending of emails from my site. Emails sent using the "Contact" forms are sent with the header using the email address given by whoever filled out the form. This is causing the emails to be rejected by the server as an unauthorised address.

    I need to change the sender address for ALL contact emails to a single address that I can authorise on the server. e.g. [email protected]. I appreciate this will prevent the recipient from just clicking "reply", but as the sender address is in the body, don't see it as a major problem.

    I guess the two files I need to edit are contact.php and contactus.php, but thought I'd try here to see if anybody knows exactly what to edit before I start trial and error.

    Thanks in advance for any help

    Andy
  2. seymourjames All Hands On Deck

    Correct - you can edit those files.
  3. ag1266 Customer

    Using SMTP email relay with authorised email address - solution

    Well after scratching my head, this appears to be incredibly straightforward. I'll stick the solution here in case anybody else ever has this requirement.

    CONTACT SELLER FORM

    Open up contact.php

    Change (around line 96)

    $vars['fromemail'] = $from;

    to

    $vars['fromemail'] = 'INSERT DESIRED EMAIL ADDRESS HERE';

    Insert another line above or below with:

    $vars['useremail'] = $from;

    To prevent the sender name being that of whoever filled out the form, just above (line 94'ish) change:

    $vars['name'] = $name;

    to

    $vars['name'] = 'INSERT DESIRED SENDER NAME HERE';

    add a line above or below:

    $vars['sendername'] = $name;

    Save contact.php

    Open up the contactowner.tpl file under "email" within your chosen template

    Change (around line 14)

    <strong>{$smarty.const.LANG_USER_EMAIL}:</strong> {$fromemail}<br />

    to

    <strong>{$smarty.const.LANG_USER_EMAIL}:</strong> {$useremail}<br />

    and change

    <strong>{$smarty.const.LANG_FULL_NAME}:</strong> {$name}<br />

    to

    <strong>{$smarty.const.LANG_FULL_NAME}:</strong> {$sendername}<br />

    CONTACT US FORM

    This is even easier:

    Open up contactus.php

    Change (around line 58):

    $vars['fromemail'] = $from;

    to

    $vars['fromemail'] = 'INSERT DESIRED EMAIL ADDRESS HERE';

    That's it. No template changes needed (at least under 4.2.4) though I did add "DO NOT REPLY TO THIS EMAIL. MAILBOX NOT MONITORED" to the email templates. Not that folk will pay any attention, but at least they're warned

    All appear to work fine. All emails generated by the package are sent with the address given in the two PHP files and which I've authorised on the SMTP relay server, but the contents of the emails still show the address given by the user.

    Simples
  4. seymourjames All Hands On Deck

Share This Page