Add the from field to the mail function

Things you'd like to see in phpList

Add the from field to the mail function

Postby esbon » 1:11am, Thu 11 Nov, 2004

wouldn't it be nice to have a place in the config.php file where you could add an email address to make it appear in the header Return_Path of you emails you send?
esbon
phpList newbie
 
Posts: 1
Joined: 1:01am, Thu 11 Nov, 2004

Re: Add the from field to the mail function

Postby simonb » 5:51pm, Tue 22 Feb, 2005

esbon wrote:wouldn't it be nice to have a place in the config.php file where you could add an email address to make it appear in the header Return_Path of you emails you send?


How about if it was part of the lindividual list configuration? Right now is seems to default to the site admin. I have commented out the code that was doing this for now as it is better the field defaults to nothing rather than I risk getting loads of emails everytime a list admin forgets to change it.
simonb
phpLister
 
Posts: 13
Joined: 9:22am, Tue 22 Feb, 2005

Postby duncan » 6:47am, Sat 13 May, 2006

I use the following inserted into send_core.php just before the creation of the from line. The array would be better in the config file. It allows a standard list of addresses for the from address - stops me making mistakes with typing

I think it might be a handy option probably an if dependent on the config to determine which way to make the addresses

Cheers Duncan

Code: Select all
$addresses=array("Sender1  email@domain.co.nz",
    "Sender2 email2@domain.co.nz","Sender3 email@domain.co.nz");

$dropdownaddresses = '<select name = from >';
if(htmlentities($from)!="")
  {
  $from_addr_sel ='<option selected>'.htmlentities($from).'</option>';
  }
else
   $from_addr_sel = "";

$dropdownaddresses .= from_addr_sel;

for ($i=0;$i<sizeof($addresses);$i++)
  {
  if (htmlentities($from)!=$addresses[$i])
    {
    $dropdownaddresses .= '<option>'.$addresses[$i].'</option>';
    };
  };
$dropdownaddresses .='</select>';



Then its just replacing the line that set the from address
Code: Select all
<tr><td><?php echo Help("from")?> From line:</td><td><input type=text name=from value="<?php echo htmlentities($from)?>" size=40></td></tr>


with
Code: Select all
<tr><td><?php echo Help("from")?> From line:</td><td><?php echo($dropdownaddresses)?> </td></tr>
duncan
PL Master
 
Posts: 179
Joined: 2:36am, Mon 19 Jul, 2004
Location: New Zealand

Postby bugsmi0 » 11:13pm, Fri 26 May, 2006

something like this should be standard on a mail list or at least the ability to set up a default From: address, its very surprising as long as phplist has been around that simple features like this haven't been included, maybe next release,

I am unable to figure out where to put this code of yours, you mentioned before the creation of the from line there's so much code makes my eyes spin lol

does this get merted with other code or does it stand alone
bugsmi0
PL Nut
 
Posts: 33
Joined: 11:08am, Sat 04 Mar, 2006

Postby duncan » 10:46am, Thu 08 Jun, 2006

Hi

The code is merged into the the existing page so if you are not comfy with it probably don't do it. In principle all its doing is finding the HTML for the FROM field and replacing it with a prepopulated drop down box

The mod it needs is for the names on the list to come from the Config.php file - I can probably edit a file for you but you would need to tell me which version you are using and what names you wanted. But as you can tell by my reply time I don't get enough time to give regular help

Cheers Duncan
duncan
PL Master
 
Posts: 179
Joined: 2:36am, Mon 19 Jul, 2004
Location: New Zealand

Postby WhiteSquaw » 11:27pm, Wed 23 May, 2007

Many hosters set Return_Path in php.ini.
WhiteSquaw
phpList newbie
 
Posts: 1
Joined: 9:13pm, Wed 23 May, 2007

Postby robreuland » 3:15am, Sun 10 Jun, 2007

Not for nothing but this forum is a pain in the arse to post in--my posts keep getting blocked because I'm a newbie here and and "posting URLs" in my posts. Which I'm not.

But anyway, I fixed this problem (on a Mac Xserve, which I administer), by opening php.ini (created from the etc/php.ini. default) and uncommenting the sendmail_path line and changing it to read:
sendmail_path = /usr/sbin/sendmail -t -i -fnoreply-at-domain.name
Nb. that there is no space between the -f and the email address.
Restart apache by issuing sudo apachectl graceful and the new php.ini should load.

Thereafter mail sent from phplist shows the same address for return-path and errors to, and bounces get dropped into "noreply."

Haven't tried to process them yet, but fingers crossed!
robreuland
phpLister
 
Posts: 11
Joined: 2:55am, Thu 24 May, 2007
Location: Brooklyn


Return to Feature Requests, Wish-list

Who is online

Users browsing this forum: No registered users and 0 guests