WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • General Community »
  • Global WebsiteBaker 2.8.x discussion »
  • multiple recipients and mail formating in mailer class
  • Print
Pages: [1]   Go Down

Author Topic: multiple recipients and mail formating in mailer class  (Read 8286 times)

Offline ruebenwurzel

  • Betatester
  • **
  • Posts: 8544
  • Gender: Male
  • Keep on Rockin
    • Familie Gallas Online
multiple recipients and mail formating in mailer class
« on: May 16, 2008, 07:43:20 PM »
Hello,

got today a mail with some nice ideas for a tweaked mailer class. Here are the descriptions and the changes:

1. multiple recipients
First change is to support multiple recipients on form submission (For example, when a user submits a web request in my case there are usually always two persons responsible - one is the primary responsible and one the secondary when the first is not available. Depending on the particular form it is other people. Creating distribution lists on the mail server is more difficult and I neither have the permissions to do that. So specifying more recpients using comma to separate multiple e-mail addresses is a good help here.

Replace Line 328 of framework/class_wb.php
Code: [Select]
$myMail->AddAddress($toaddress);with:
Code: [Select]
$addresses = explode(",", $toaddress);
if (count($addresses) > 0) {
    for ($i = 0; $i < count($addresses); $i++) {
        $add = trim($addresses[$i]);
        $myMail->AddAddress($add);
    }
} else {
    $myMail->AddAddress($toaddress);
}

2.) Email output:
Second change is because of the fact that the form e-mail sent arrives in a one-liner getting wrapped to multiple lines somewhere which makes the e-mail not very readable.

Replace Line 331 of framework/class_wb.php
Code: [Select]
$myMail->AltBody = strip_tags($message);with:
Code: [Select]
$myMail->AltBody = str_replace("<br \\>", "\r\n", $message);
So please test it.

Matthias
Logged

Offline diodak

  • Posts: 85
Re: multiple recipients and mail formating in mailer class
« Reply #1 on: May 17, 2008, 08:25:11 AM »
As I understand, i can add several e-mail addresses at form module like in example: test1@tes.com, test2@tes.com, test3@tes.com which in fact I`m doing on some of my websites and this snippet will send 3 mails for several addresses that none of the recepitnents will know about each other?
Logged
Buchsbaum

Lotus

  • Guest
Re: multiple recipients and mail formating in mailer class
« Reply #2 on: May 26, 2008, 10:08:10 AM »
hmm, in WB 2.7 you can have multiple recipients in the settings for form by separating them with a "," but all adresses will show in the recipients mail, as in "TO". (I have tried two adresses).

@ruebenwurzel will this make a recipent "BCC" instead of "TO"?
Logged

Offline DGEC

  • Posts: 388
  • Gender: Male
    • EbelTech homepage
Re: multiple recipients and mail formating in mailer class
« Reply #3 on: June 02, 2008, 01:02:57 AM »
I don't think that gets bcc.. seems to be tricky,, try this guy's solution:
http://www.phpbuilder.com/board/showthread.php?t=10314199
Logged

doc

  • Guest
Re: multiple recipients and mail formating in mailer class
« Reply #4 on: June 02, 2008, 07:39:46 AM »
@DGEC:
Multiple BCC, CC and TOs is easy to integrate with the PHPMailer class. Have done this for a customer some time ago for the massmail module. If I find the time I will post the solution in the massmail thread.

Regards Christian
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • General Community »
  • Global WebsiteBaker 2.8.x discussion »
  • multiple recipients and mail formating in mailer class
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2