We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8168
    • 1,118 Posts
    Hi, I hope someone can help here - I need to hardcode a email address from which all emails to do with WebloginPE will be sent - the main one being the email that is sent to a user after they have registered as a new web user... Currently the server I have the site installed on has very very high security re: sending emails from form scripts and thus it currently does not send the registered user their password and welcome email!!! Not good!!! (note the normal weblogin method works fine???)

    Can someone let me know how I can hardcode [email protected] into the relevant places so that I can ensure the emails are coming from a trusted source and therefore hope the server will send them? I have found this that relates to these bugs and possibly this might also need integrating??? http://www.lessfussdesign.com/blog/2009/10/php-mail-fasthosts/


    Many thanks!

    dubbs
      • 8168
      • 1,118 Posts
      Note - this is the formal situation on the hosting - http://www.fasthosts.co.uk/knowledge-base/?article_id=65

      PHP
      Use the PHP mail function and set the mail from using the following line of code - replacing $email_from with the correct domain name.

      * ini_set("sendmail_from", " $email_from ");

      You need to add a fifth "-f" parameter to the sendmail function. This will set the name of the from address.

      * mail($email_to, $email_subject, $email_message, $headers, ’-f’.$email_from);

      This is covered in the article EXAMPLE: ’Form to Mail’ script using PHP.
        • 8168
        • 1,118 Posts
        P.S. I fixed this for anyone who is interested - fix below:

        In the file Manager/Includes/Controls/class.phpmailer.php

        Hard code in the email address from the domain (that is valid) for these items:

        /**
        
             * Sets the From email address for the message.
        
             * @var string
        
             */
        
            var $From               = "[email protected]";
        
        
        
            /**
        
             * Sets the From name of the message.
        
             * @var string
        
             */
        
            var $FromName           = "[email protected]";
        
        
        
            /**
        
             * Sets the Sender email (Return-Path) of the message.  If not empty,
        
             * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
        
             * @var string
        
             */
        
            var $Sender            = "[email protected]";