[SOLVED]Problem sending email |
[eluser]bondjp[/eluser]
Hi, how can i send 2 emails to 2 different users with 2 different messages? I can send one email without any problem but i'm not seeing how can i send a second email to another person with another message. Thanks. Here's my code for one email: Code: $config['protocol'] = 'mail';
[eluser]Ben Edmunds[/eluser]
Just change your $data array and reference those variables in your view. Really not sure I see the problem?
[eluser]bondjp[/eluser]
I'm using this in my controller. When something happens i send 2 emails to 2 different users with 2 different messages(views). Using the example i put how can i send at the same time a second email to :$this->email->to($data['secemail']); with subject: "Subject Second Email" and with message: $this->load->view('email/secondconfirmed-html' ? Thanks.
[eluser]Ben Edmunds[/eluser]
You code do: Code: $this->email->from('[email protected]', 'My site'); Or you could put it into a loop and use variables. How new are you to PHP? Do you understand looping and variables? Don't take offense, just trying to see what level you are on...
[eluser]bondjp[/eluser]
[quote author="Ben Edmunds" date="1269248973"]You code do: Code: $this->email->from('[email protected]', 'My site'); Or you could put it into a loop and use variables. How new are you to PHP? Do you understand looping and variables? Don't take offense, just trying to see what level you are on...[/quote] I tried that but it sends both emails to the second user... I'm new to php and i know what loops and variables are. Thanks
[eluser]Ben Edmunds[/eluser]
Post the code you used including the variable declarations. Thanks,
[eluser]bondjp[/eluser]
Nevermind, it works like you posted. I just can't believe i had the same email on both users... :red: Sorry for waisting your time. |
Welcome Guest, Not a member yet? Register Sign In |