Mail sending problems. |
[eluser]Adam Griffiths[/eluser]
My model... Code: <?php My controller... Code: <?php The form in my view... Code: </div> I get this from the debugger in the email class. Quote:Your message has been successfully sent using the following protocol: mail So I know everything I put into the form is coming out the other end in the model etc. But the email doesn't get to my mailbox. Junk goes into my inbox anyway, so it isn't that the mail() function is blocked. I've tried it on two accounts. Can anybody see the problem? This is my first time using the email library so I'm a total newb with it. Thanks in advance!
[eluser]Nathan Moore[/eluser]
Try using a different mail protocol and see if that helps. For example, try adding these lines before sending the email: Code: $config['protocol'] = 'sendmail'; The default protocol is mail (php)... Try sendmail and if that does not work, try using SMTP. Just as a sidenote, you should probably send the email from the controller, not the model. Only use the model to interact with the database.
[eluser]Nathan Moore[/eluser]
It looks like the variables are not being set. Where did you place the initialize code? Try to put it before you set the from, reply-to, to, etc.
[eluser]Adam Griffiths[/eluser]
[quote author="Nathan Moore" date="1217285312"]It looks like the variables are not being set. Where did you place the initialize code? Try to put it before you set the from, reply-to, to, etc.[/quote] Here is my new model. Code: <?php The debugger says this... Quote:Your message has been successfully sent using the following protocol: sendmail But once again the email has not been sent. I tried it with two emails and they both didn't get the email. Edit: I echo'ed the variables from inside the model, and they are the same as in the form... Quote:Name: Adam Griffiths I edited out my emails again.
[eluser]Adam Griffiths[/eluser]
[quote author="audiopleb" date="1217292178"]Are you using plesk on your server?[/quote] No, I'm on servage so it's the Servage CP.
[eluser]johnwbaxter[/eluser]
Well that's one thing to rule out then. Have you been able to send any e-mails out from the server at all? Other domains, CPanel mails perhaps (but sent from your server)?
[eluser]Adam Griffiths[/eluser]
I just used an old contact form I have in the same directory as the CI install, and it works fine. It uses mail().
[eluser]johnwbaxter[/eluser]
Ah good. I just wanted to narrow down the possible reasons. I'll have a thorough look at this tomorrow. |
Welcome Guest, Not a member yet? Register Sign In |