Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 05:55:23 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155555 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Newbie - email cc's from signup - more info.  (Read 2013 times)
Don

Offline Offline

Posts: 70


« on: November 13, 2007, 03:15:22 AM »

Hello there!

I have been unable to resolve sending cc's to my own email box problem at user signup myself.   sad

I am using the update from 2.2.6 to 2.6.7 files. Since I could not get php mail to work I am using smtp and have modified the files suggested in the forums and this part of the sign up process works fine.  However, I still cannot seem to add any code that supports sending me a carbon copy when the new user signs up.  So what I did was to ask my provider if they actually supported php mail.  I got the reply as follows below.

"Mail() and SMTP function are available for your account and you can use them.  I suggest you to usermail() function because it is faster then SMTP connection, but have in mind that the FROM field in your script has to be a real mailbox within your account hosting services with us."

So my questions now are: to try to get the php mail working, exactly where (in which file) do I add my email address to the FROM field to try and get php mail to work, as suggested by provider.  And can anyone out there relieve my misery and suggest some code for cc's at sign up.

Thanks,
Logged
ruebenwurzel
WebsiteBaker Org e.V.

Offline Offline

Posts: 7973



WWW
« Reply #1 on: November 13, 2007, 04:52:58 AM »

Hello,

to switch over from SMTP Mail to PHP mail simply comment out the line in the config.php.

Matthias
Logged
Don

Offline Offline

Posts: 70


« Reply #2 on: November 13, 2007, 05:05:33 AM »

Thanks for your reply.  Yes I understand this, but will uncommenting the line insert the below requirement automatically?

  "but have in mind that the FROM field in your script has to be a real mailbox within your account hosting services with us."

Please bear with me, I am quite confused and very frustrated over my lack of knowledge here!   I cannot connect all the dots!  embarassed

Thanks.
Logged
ruebenwurzel
WebsiteBaker Org e.V.

Offline Offline

Posts: 7973



WWW
« Reply #3 on: November 13, 2007, 06:10:29 AM »

Hello,

Quote
So my questions now are: to try to get the php mail working, exactly where (in which file) do I add my email address to the FROM field to try and get php mail to work, as suggested by provider.

Go to advanced options of WB and the User settings and add there the email adress. So as far as i understand your hoster only allows email adresses from within your account. So if your account is "example.com" the email adress has somtething to be like ...@example.com.

Quote
I am using smtp and have modified the files suggested in the forums

Can you explain this a little bit more?

Matthias
Logged
Don

Offline Offline

Posts: 70


« Reply #4 on: November 13, 2007, 03:00:13 PM »

Ah!!!!  The email address there is one of my other email accounts on a quite different provider.  Maybe it has to be my email account on the website's server.  I'll try that later and see if php will run.


Quote
I am using smtp and have modified the files suggested in the forums

Can you explain this a little bit more?

Matthias

Well, since I could not get php to work, I modified class.wbmailer.php to insert my account user name and password in the file as below.

// Include PHPMailer class
require_once(WB_PATH."/include/phpmailer/class.phpmailer.php");

class wbmailer extends PHPMailer
{
    // new WebsiteBaker mailer class (subset of PHPMailer class)
    // setting default values

    function wbmailer() {
        // set method to send out emails
        if(defined('WBMAILER_SMTP_HOST')) {
            // sets Mailer to send messages using SMTP
            $this->IsSMTP();                                           
            $this->Host = WBMAILER_SMTP_HOST;
      $this->SMTPAuth = true;                     // SMTP with authentification
                        $this->Username = "xxxxxxxx.ca";      // SMTP-Username
                        $this->Password = "mypassword";            // SMTP-Password                        // use STMP host defined in config.php
       
This is where I am confused.  I thought that in ver 2.6.7, if php was commented out in config.php, then SMTP would be used with no file alteration needed.  I could not get it to work without doing the above.

Ok thanks for your help, I will try the php mail again using another address in User Settings and I'll let you know what happens.  I'll worry about the cc's later.

Onward and Upward!  grin
Logged
ruebenwurzel
WebsiteBaker Org e.V.

Offline Offline

Posts: 7973



WWW
« Reply #5 on: November 13, 2007, 03:59:39 PM »

Hello,

Quote
I thought that in ver 2.6.7, if php was commented out in config.php, then SMTP would be used with no file alteration needed.

Just to make things clearer:

This is for php
Code:
// define('WBMAILER_SMTP_HOST', 'mail.example.com');

This is for smtp
Code:
define('WBMAILER_SMTP_HOST', 'mail.example.com');

Matthias
Logged
doc
Guest
« Reply #6 on: November 13, 2007, 04:00:56 PM »

Hello,

as mentioned in this knowledge base article, SMTP authentification is not implemented in v2.6.7.
Only if your server requires SMTP authentification, and you can not use PHP mail instead, you have to modify the class.wbmailer.php file.

Regards Christian
Logged
Don

Offline Offline

Posts: 70


« Reply #7 on: November 13, 2007, 04:18:36 PM »

OK Reueben and Christian, I understand,  and I did not appreciate the authentification part of SMTP.

I have set my email address in my settings to one on my Provider.

Have set config.php as per Reueben for php.

Have re-overwritten old files with new copies of 2.6.7. (not config or template).

Attempted a test signup.

Database is updated with new user info, but no email sent to new user.

I have tried this using php 4 and 5 on server.

So I am stuck here as far as php mail is concerned.  It has to do with settings of my provider or something, as I know this script works for other people using different servers.

I appreciate your help, thanks.
Logged
Don

Offline Offline

Posts: 70


« Reply #8 on: November 13, 2007, 05:50:19 PM »

Let me go back a little.  In this thread

 http://forum.websitebaker.org/index.php/topic,5101.msg35234.html#msg35234

Christian says:  P.S.: We should add this feature to the next WB version 2.7

If I have the new files for ver 2.6.7, should I see a new Settings form when I access my Admin area where some of these options can be configured?  I see nothing different in mine from previous versions.

And this is also where I got the information to send SMTP.
Logged
ruebenwurzel
WebsiteBaker Org e.V.

Offline Offline

Posts: 7973



WWW
« Reply #9 on: November 13, 2007, 06:01:37 PM »

Hello,

as Christian said this will be in 2.7.x and not in 2.6.7. In 2.6.7 you have to enter SMTP Auth in the core files as described on the help page.

Matthias
Logged
doc
Guest
« Reply #10 on: November 13, 2007, 06:23:54 PM »

Hello Don,

the forum thread you refer in Reply#8 shows my private implementation which is not released. To make all WB mailer settings configurable via the WB backend, would required to change the WB database. Database changes are only "allowed" in major WB releases (e.g. 2.6.x to 2.7).

So no, you do not miss settings, there are no settings. The thread on the help website is up to date and explains all required steps to get emails running.

a) check if it works with PHP mail -> comment out the line in config.php
    if it does not work, check all the traps (sender email from GMX but sent via PHP ...)
b) if this does not work, try SMTP
c) ask your provider if he supports SMTP without authentification
d) if not you need to add the lines mentioned on the help site and add the SMTP host to the config.php
e) please search the forum, I posted a simple PHP script to check which solution works

Good luck
Christian
« Last Edit: November 13, 2007, 06:26:20 PM by doc » Logged
Don

Offline Offline

Posts: 70


« Reply #11 on: November 14, 2007, 02:29:50 AM »

Hi Christian:

OK thanks, very concise and informative replies from you and Matthias.  I just thought I was missing something in my update.  embarassed

So this is where I am:

I just cannot get php mail to work at all and my server does not support SMTP without authentication.  So I have modified the files as suggested and I am now sending mail by SMTP.  This is working just fine.

I appreciate all the replies I have had, you people do a fine job supporting users - very impressive.

Now ..... if I could only send myself a cc of the signup information using SMTP!  rolleyes

Great help, thanks again.

Don

Logged
doc
Guest
« Reply #12 on: November 14, 2007, 05:45:06 AM »

Hello Don,

to send a CC from signup you need to modify another core file of website baker. A solution was posted here in the forum some days ago (German subforum). You need to add some text to the header string in the signup.php or signup2.php (check the URL to find the location of the file in the WB framework).

Good luck
Christian
Logged
Don

Offline Offline

Posts: 70


« Reply #13 on: November 14, 2007, 06:47:18 PM »

Hi Christian:

Well, this is what I did:

A friend suggested some code for me and I inserted it at the bottom of the existing account/signup2.php file.  It now looks like this.

    // Try sending the email
    if($wb->mail(SERVER_EMAIL,$mail_to,$mail_subject,$mail_message)) {
        $wb->print_success($MESSAGE['FORGOT_PASS']['PASSWORD_RESET'], WB_URL.'/account/login'.PAGE_EXTENSION);
        $display_form = false;
    } else {
        $wb->print_error($MESSAGE['FORGOT_PASS']['CANNOT_EMAIL'], $js_back, false);
        $database->query("DELETE FROM ".TABLE_PREFIX."users WHERE username = '$username'");
    }
}

// Send Administrator a message

    $mail_subject = 'New User';
    $mail_to = 'xxxxl@xxxxxnet.com';
    $mail_message = ''.
 'A new user: '.$display_name.' has signed up to the website.';

    $wb->mail(SERVER_EMAIL,$mail_to,$mail_subject,$mail_message)

?>

This works just fine.  It may not conform exactly with php standards and has no error traps and such, BUT it works and this is exactly what I wanted to do.  So....there is the solution - for my  SMTP mail anyway.

Thought you would like to know how I ended up, and thanks for your help.

Oh, I did manage to translate the German link you sent to, but it was way over my head even so. huh

Thanks again

Don
Logged
gavjof

Offline Offline

Posts: 89



WWW
« Reply #14 on: April 21, 2008, 05:28:44 PM »

Neat little piece of code for a cc Don. I'm using it for one of my sites.

Many thanks  cheesy

gav
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!