Welcome Guest, Not a member yet? Register   Sign In
Emails not being sent on!
#1

Hi;

Locally emails get sent easy. But on line server no Sad

Any ideas?

PHP Code:
$this->load->library('email');
 
$this->email->from('****@yahoo.com''Valentino');
 
$this->email->to($this->input->post('email'));
 
$this->email->cc('****@yahoo.com');
 
$this->email->subject('Welcome to ****\'s webinar');
 
$this->email->message('Thanks for signing up. See you on Thursday Feb 15th 5pm Pacific time');
 
$this->email->send(); 
Reply
#2

What are your email settings?
Do you use standardmail from PHP?
A mailserver is available on your server?
Do you have checked it th post-variable "email" is not empty?

Reply
#3

(01-23-2015, 10:10 AM)Rufnex Wrote: What are your email settings?
Do you use standardmail from PHP?
A mailserver is available on your server?
Do you have checked it th post-variable "email" is not empty?

Mail can be complex. Your online server may not even be capable of sending mail.

If you are running your code on a server allocated from the cloud (Rackspace Cloud Servers, Amazon EC2 instances, etc.) then the server might be prohibited by policy from sending any mail at all. In that case, you would need to configure your code to send mail via some other mail service like an SMTP server or SendGrid (recommended by Rackspace) or Amazone SES for Amazon cloud servers.

It's not especially hard to send mail from PHP using a gmail account, but I'm not especially familiar with how to do this using CI.
Reply
#4

(01-23-2015, 10:10 AM)Rufnex Wrote: What are your email settings?
Do you use standardmail from PHP?
A mailserver is available on your server?
Do you have checked it th post-variable "email" is not empty?
Hi;

When I use codeigniter's email it doesn't send emails but I get: "our message has been successfully sent using the following protocol: mail".

But when I use PHP's email it works:

PHP Code:
mail($this->input->post('email'), 'Welcome to Valentino\'s webinar''Thanks for signing up. See you on Thursday Feb 15th 5pm Pacific time'); 

Strange.
Reply
#5

Strange, your code is right. Try to ad this afer you load the lib:

PHP Code:
$this->email->set_newline("\r\n"); 

And also check for errors:

PHP Code:
echo $this->email->print_debugger(); 

Reply
#6

(01-23-2015, 02:10 PM)behnampmdg3 Wrote: When I use codeigniter's email it doesn't send emails but I get: "our message has been successfully sent using the following protocol: mail".

But when I use PHP's email it works:
PHP Code:
mail($this->input->post('email'), 'Welcome to Valentino\'s webinar''Thanks for signing up. See you on Thursday Feb 15th 5pm Pacific time'); 

Sending mail is one thing, getting it to arrive at its destination is another. Sounds to me like CodeIgniter might be constructing email messages that fall afoul of some spam filter somewhere. Mail filters can respond to all kinds of problems. Some mail headers might be added which cause your email to look like spam.

I had an issue sending email via Amazon SES where mail headers generated by my server were simply rejected by a mail gateway because it didn't recognize them.

When you say you get a message, could you elaborate where you are seeing that message? Do you have access to the mail log on the server? Can you inspect the email that is getting sent but not arriving and compare it to the email that is sent and successfully arrives?
Reply
#7

Hello;

Like I mentioned above, I can send (and receive) emails with php's mail() function.
So the issue is not the receiver or the hosting company : )
Reply
#8

(01-23-2015, 06:25 PM)behnampmdg3 Wrote: Hello;

Like I mentioned above, I can send (and receive) emails with php's mail() function.
So the issue is not the receiver or the hosting company : )

So it looks like you are going to have to try a few things to find out what is wrong with the way that CodeIgniter is doing things differently.
Reply
#9

(01-23-2015, 07:03 PM)sneakyimp Wrote:
(01-23-2015, 06:25 PM)behnampmdg3 Wrote: Hello;

Like I mentioned above, I can send (and receive) emails with php's mail() function.
So the issue is not the receiver or the hosting company : )

So it looks like you are going to have to try a few things to find out what is wrong with the way that CodeIgniter is doing things differently.
Does it have anything to do with CI version 3?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB