![]() |
Send HTML emails from adminCP
Well, this was asked for by many people (me included :) ) without ever being done so things are never done for those who want but not prepared to do for themselves! Thus, a hack is borne!
This hack does what it says on the label. Having come from IPB to vB, I was surprised to see that a default "Send HTML email" from the adminCP was lacking as I used it in my IPB board for newsletters and such. This hack adds the ability to use the default email template that sends plaintext emails or, but toggling the radiobutton, will send HTML mime emails. Unfortanatly, I am not familiar enough with vB's hooks/plugins so it is done with 2 file edits but I'm sure that it could be done with a plugin if someone ever feels the need... Step 1: In admincp/email.php find: Code:
print_textarea_row($vbphrase['message_email'], 'message', '', 10, 50); Code:
print_yes_no_row('Send HTML Email?', 'sendhtml', 0); In admincp/email.php find: Code:
construct_hidden_code('test', $vbulletin->GPC['test']); Code:
construct_hidden_code('sendhtml', $_POST['sendhtml']); In includes/class_mail.php find: Code:
$headers .= 'Content-Type: text/plain' . iif($encoding, "; charset=\"$encoding\"") . $delimiter; Code:
if($_POST['sendhtml']) { (you may modify this hack at will... No permission needs to be granted) **Tested and works for vB versions 3.5.0 to present (3.7.1PL)** |
Thick moment here but does this allow it to send a image so the image is seen when email opened. like u get in alienware email for example. if so just what i need :D
|
File edits
EEK |
I was actually looking at your 3.5 hack yesterday! Thanks for the update.
|
Quote:
|
Quote:
|
Quote:
So, you'd have your email: Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Blah blah blah Then you want an image, you'd do it just like a webpage: <img src="http://www.domain.com/image.jpg"> Then, when the emails are opened *WITH* a HTML ready email client, you have a pretty email! Quote:
Quote:
|
I hope this isn't bad form, but when I saw that this mod required file edits :eek: , I posted a handy little pluggin that automatically sends out any message with HTML in the body text as an HTML email, including from the ACP! :) Check it out here.
I thought I'd give you folks a heads up! :D |
I second bchertov's hack. Elegant and simple to install.
|
I installed with the file edits as I had done in a previous ver of VB.
Thank you. |
Is it wysiwyg editory like?
|
Dear tokenyank,
I try it in VB 3.6.5 and worked very well, Thank you so much. Regards, ThunderWolf |
Works great, thanks! :)
vBulletin 3.6.4 |
Quote:
Thank you Tokenyank. |
Wow! Great add on I just installed! There's a way to add extra emails also to send it to people not subscribed to the forum??
|
And there's a way to send php emails?
|
No because php is a server side language which means any php embedded into an email would only parse IF the enduser had LAMP on their machine and would accept random php from executing from Outlook!
|
I have just installed this on my forum and it's working great, thank you! I've waited so long for such a hack and you made my dream come true. This is the first HTML email hack that I had absolutely no problems installing - ind it only took me like 2 minutes as well. You're a hero!
|
fantastic... thanks
|
Quote:
I absolutely agree. :D I am going to use this alot :p Clicked Installed |
it dont work!
i think there is problem in this code: Code:
print_yes_no_row('Send HTML Email?', 'sendhtml', 0); i changed this code and problem solved: Code:
if($_POST['sendhtml']) { what is that question? how may i answer that? thx |
No Answer?!
|
does this work on vb 3.6.8 ?
|
Quote:
|
So I tested it and received the email that contained a big paragraph of text (presumable the text version of my html email, only it was all one big paragraph) and then the html newsletter showed up underneath all the text. What happened? I'm using 3.6.8.
|
I've tried changing from PHP to SMTP and get the same results. Is this due to an Outlook setting maybe?
|
Can you see a preview of the email you have made?
|
Quote:
|
It works great !
3.6.7 thank you ! |
tokenyank, it work very well for me :)
Thanx :) |
I went ahead and installed that today. I was bored. It works great! I just don't like editing the php files. It sucks when the vB updates come out because my old brain forgets what I have to go and edit. LOL
|
Is it possible to send both plain text and html email versions?
|
this working perfect on my 3.7.0 Gold !!
i hope vB team soon gets this feature inbuilt with nice extra features !! thanks a lot .. |
Does it work with vb 3.6.10 ?
|
Quote:
|
Could anyone show me a demo of the newsletter?
Can we set duration to send the newsletter, like weekly or monthly? |
Quote:
Quote:
Quote:
Quote:
As to scheduling, no, there's no way to add scheduling to this... If you want something that robust, you'll need to use Sendstudio or OemPro or similar. |
Quote:
|
Some things work like that, yes bchertov... My particular hack isn't that smart.
There is a toggle that you have to explicitly say whether the email is to be sent via plaintext or HTML. If you put HTML in the editor box and hit send without toggling the HTML option, the email will be sent out plaintext. As I said before, I'm not clever enough to make this as good as it could be or do it without code edits... This suits my needs and thus I put it here to hopefully help someone else.. |
Quote:
Quote:
B |
All times are GMT. The time now is 04:22 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|