Please help me to send mail this way |
[eluser]dhaulagiri[/eluser]
Hi all I want to send all the variables and strings inside the opening and closing of form tag in email. Can anybody give me a breif example what to write in a controller ? my view file is like this Code: <?php echo form_open('latest/send_email')?>
[eluser]Flemming[/eluser]
you can load a view into a variable like this: Code: $data['name'] = 'my name'; now you can send your email, and use $email_content as the message: Code: $this->email->message($email_content); your email_view.php would look like this: Code: Dear $name, hope that helps?
[eluser]dhaulagiri[/eluser]
Thank you so much, it was successful. However, all the html is being sent as email including stylesheet and eveything, is it possible to parse html ?
[eluser]Flemming[/eluser]
have you set: $config['mailtype'] = 'html'; ? if you want to send HTML email you should write a view that contains HTML specially written for an email and it shouldn't use CSS
[eluser]dhaulagiri[/eluser]
i did create email.php in config folder and wrote this Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); and added this in controller Code: $this->load->library('email', $config); still problem exists pls help. Please enlight me how to send HTML email.
[eluser]dhaulagiri[/eluser]
view file is as follows Code: <style>
[eluser]Flemming[/eluser]
that's a form? Sorry, am a little confused about what you're trying to do! I thought you wanted to send an email with $data in it? could you explain your process simply?
[eluser]Ivar89[/eluser]
in system folder->libraries there is a file called Email.php change mailtyp te HTMl there then: Code: $this->load->library('Email'); from the look of your view I see that name and such is already posted from an other page? any you should write in controller(what flamming wrote: Code: $data['first_name'] = '$_POST('first_name;)'; Code: $first_name last_name, EDIT: >>>this is without form_validation though<<< |
Welcome Guest, Not a member yet? Register Sign In |