![]() |
problem sending html email - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: problem sending html email (/showthread.php?tid=17619) |
problem sending html email - El Forum - 04-09-2009 [eluser]PermanaJ[/eluser] I got problem when trying to sending HTML email. The email was sent but I cannot read the email. The result is like picture below http://i264.photobucket.com/albums/ii162/mypermana/scrshoot.jpg I have a view for HTML email application/views/mail/mailtest.php Code: <html> and i have this controller application/controller/test.php Code: <?php problem sending html email - El Forum - 04-09-2009 [eluser]NogDog[/eluser] Maybe stick in a little debug code to verify that $body has been populated? problem sending html email - El Forum - 04-10-2009 [eluser]TheFuzzy0ne[/eluser] Another thing to try, might be to check the source code of the received message. problem sending html email - El Forum - 04-14-2009 [eluser]bsauls[/eluser] Family Values I don't know that this would cause the problem, but 12px is not a font-family value. Something like font-family: sans-serif; font-size: 12px; would work Also, you have two close para tags instead of one. Again, it doesn't seem like a couple of syntax errors would cause the problem, but I basically replicated your code minus these errors and it worked. function sendmail2() { $config['mailtype'] = 'html'; $config['wordwrap'] = TRUE; $this->email->initialize($config); $firstname = 'Celia'; $lastname = 'Cardholder'; $email = '[email protected]'; $passwd = '1Whatever'; $this->load->library('Email'); $this->email->from('[email protected]', 'Your Website'); $this->email->to('[email protected]'); $this->email->bcc('[email protected]'); $this->email->subject('Registration for My Website'); $message ='We hope that online access to our inventory will be a great convenience for you. You are now registered as '.$firstname.' '.$lastname.'. <br> <br> Go to <a href="http://www.yourwebsite.com/member/login">http://www.yourwebsite.com</a> and logon using: '.$email.' with password: '.$passwd.' <br> <br> Regards <br> <br> My Website'; $vars['message'] = $message; $body = $this->load->view('mail/welcome', $vars, true); $this->email->message($body); $this->email->send(); echo $this->email->print_debugger(); } problem sending html email - El Forum - 05-10-2009 [eluser]PermanaJ[/eluser] when i try using the print debugger, there are some message like this Code: ... what does it mead ? does it mean that the email format still in plain text ... ? problem sending html email - El Forum - 05-10-2009 [eluser]PermanaJ[/eluser] new problem when I upload the script, they cannot send email ... what will be the setting on the server .. ? problem sending html email - El Forum - 05-10-2009 [eluser]Cro_Crx[/eluser] Your email settings will depend on the machine that your running it on or you host. If you have a shared web server your host will set it up for you so you might want to contact them if your having issues. If your running a local machine or have a dedicated server your going to have to setup your SMTP settings in the php.ini file yourself. Alternativly you can use the SMTP settings in the email class, but setting the settings on the server itself would be much better. Codeigniter SMTP settings can be set in the email class http://ellislab.com/codeigniter/user-guide/libraries/email.html Good luck problem sending html email - El Forum - 05-10-2009 [eluser]PermanaJ[/eluser] [quote author="Cro_Crx" date="1242036862"]Your email settings will depend on the machine that your running it on or you host. If you have a shared web server your host will set it up for you so you might want to contact them if your having issues. If your running a local machine or have a dedicated server your going to have to setup your SMTP settings in the php.ini file yourself. Alternativly you can use the SMTP settings in the email class, but setting the settings on the server itself would be much better. Codeigniter SMTP settings can be set in the email class http://ellislab.com/codeigniter/user-guide/libraries/email.html Good luck[/quote] thankyou very much, I just mail the host. Im on shared web server ... Oh actually, my hosting account is set up for example.net but i create folder example and add a domain example.com, is there will be causing any problem ... ? I personally think it wont, but i want to know what others think [sorry for bad english] problem sending html email - El Forum - 05-20-2009 [eluser]PermanaJ[/eluser] Ok, Looks like I can send HTML message using SMTP protocol. And still cannot send email using mail function ... |