Welcome, Guest. Please Login or Register.
May 05, 2025, 10:59:02 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  HTML for,at when sending emails to members « previous next »
Pages: [1] Reply Ignore Print
Author Topic: HTML for,at when sending emails to members  (Read 367 times)
cvek
Noobie
*
Posts: 30


I'm a llama!

HTML for,at when sending emails to members
« on: September 27, 2002, 06:27:34 PM »
Reply with quote

Hi!

any idea what to do, to be able to send html emails when sending out mails to our members .. currently they are in pure txt format

tanx
Logged
Jack.R.Abbit
Mod Team
YaBB God
*****
Posts: 553


RACE FOR SPENT!

Re:HTML for,at when sending emails to members
« Reply #1 on: September 30, 2002, 04:19:52 PM »
Reply with quote

cvek,

Here is the quickest mod I could put together.  End result is a decent looking html email.  You will likely want to play around a bit with the html that was inserted into the message.  Currently, to allow for the text and link that get appended to the end of the message, you should not put the <html><body></body></html> tags in the email message.  Using this replacement code, they are added in for you.  If a person were so inclined, they could extend this to allow you to choose to send it as html or not.  But I've not the time to do so now.
<file>
Sources/Subs.php
</file>

<search>
    $message = stripslashes($message);
   $mail_result = mail ($to,$subject,$message,
      "From: $from\r\n".
      "Return-Path: $webmaster_email");</search>

<replace>
      $message = stripslashes($message);
      $htmlmessage = "<html><body>\n";
      $htmlmessage .= $message;
      $htmlmessage .= "\n</body><html>";
      $headers = "From: $from\n";
      $headers .= "Return-Path: $webmaster_email\n";
      $headers .= "Content-type: text/html; charset=iso-8859-1\n";
      $mail_result = mail ($to,$subject,$htmlmessage,$headers);
</replace>

<file>
Sources/Admin.php
</file>

<search>
         sendmail( $curmem, "$mbname: $subject", "$message\n\n$txt[130]\n\n$scripturl");
</search>

<replace>
         sendmail( $curmem, "$mbname: $subject", "$message<br>\n<br>\n$txt[130]<br>\n<br>\n<a href=\"$scripturl\">$scripturl</a>");
</replace>

You will also want to edit your language file. Look for $text[130].  This is what gets appended to the message.  You will need to make this text htm-friendly by adding in some <br> tags where ever it has "\n"  OF course you could eliminate that all together and just type it in each time you send an email.

The sendmail() function that you are modifying in the Subs.php uses the built-in php mail() function.  More information about this function can be obtained at http://www.php.net/manual/en/function.mail.php

I hope this helps.

May I also invite you to check out my mod allowing you to send emails to certain member groups rather than your whole member list. Send Email By Member Groups

-Jack
« Last Edit: September 30, 2002, 04:25:00 PM by Jack.R.Abbit » Logged

<--------  Mods by Jack  -------->
Package Server: http://www.modsbydesign.com/mods.by.jack/yabbse/ (now serving)


|----------------------------------------------|
|                                              |
|          DON'T PM ME FOR SUPPORT!             |
|                                              |
|----------------------------------------------|
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  HTML for,at when sending emails to members « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.122 seconds with 20 queries.