Sending an Email does not seem to work |
[eluser]No0oB[/eluser]
Hey guys. I have recently been struggling with the Email-Class of CodeIgniter. When sending the email, I do not get any errors, in fact, it sais the the Email has been sent, however, I enver receive an email (just on google it works - no idea why..) Following Code should send the Email. $userdata is a parameter given to the function in an own class. Code: $email_body = $this->CI->lang->line('user_register_email_header'); This is the Email-Body (Yeah, it is german, but that should not be the problem ) Code: $lang['user_register_email_header'] = 'Hallo und vielen Dank für die Registrierung bei dem Browsergame Atlantica! Any advice?
[eluser]Josh Kendall[/eluser]
What does the script output from the print debugger function? Does your server have PHP's MAIL installed? I know at work one of the servers doesn't, so that could be a possibility. Have you tried changing the protocol to sendmail or smtp?
[eluser]No0oB[/eluser]
Thank you for your reply John. Here is, what the debugger is returning: Quote:From: "This Browsergame" Is it normal that Return-Path is empty? And no: I have not yet tried to change the protocol because I do not know why I should use which protocol
[eluser]Josh Kendall[/eluser]
No0oB, can you change your code from: Code: if (!$this->CI->email->send()) to Code: $this->CI->email->send() and see if the results of the print_debugger function is different. This way it always gives you the results of the message, and it should tell you that your message did one of two things. 1. Sent Successfully: "Your message has been successfully sent using the following protocol: mail" 2. The message failed, and a reason. What you posted from the print_debugger function said neither of those things.
[eluser]No0oB[/eluser]
I did it the way you üpropsed it, I just forgot to paste the first line. I am very sorry abou that Quote:Ihre Botschaft ist erfolreich verschickt worden. Verwendetes Protokoll: mail The first line is your line, just in german.
[eluser]Josh Kendall[/eluser]
Yeah, you don't appear to have PHP mail installed on your server. You could try Sendmail: Code: $config['protocol'] = 'sendmail'; You may need to change the path to sendmail depending on your server.
[eluser]No0oB[/eluser]
Ah I see. So I have to initilize each time I want to send it or can I extend the Emailclass and put it into the constructor / send ? Thank you very much for your help
[eluser]Josh Kendall[/eluser]
If you look in the libraries/Email.php file on line 33 you will see: Code: var $protocol = "mail";// mail/sendmail/smtp if you change that to: Code: var $protocol = "sendmail";// mail/sendmail/smtp You probably won't need to add anything in your code as CI will default to Sendmail.
[eluser]No0oB[/eluser]
One more question. Why did I yet receive Emails with gmail? Edit: Nevermind that, I still don't get Emails Here is the phpinfo: http://bg.phpdave.com/info.php I want to use the config-method Quote:Setting Email Preferences in a Config File Now, I do have a config file located at application/config/email.php with following contents Code: <?php Yet, the debugger tells me that the protocol I am using is mail.... Edit2: The only way I got sendmail to work is to use the $config directly in CI with initializing the library. So, it ended up showing sendmail, but I still dont get any email. Seriously, what is going on? I mean.. mail() works.. |
Welcome Guest, Not a member yet? Register Sign In |