[plugin: Mail2List] Send mail to your list via email client

3rd party code for phpList

[plugin: Mail2List] Send mail to your list via email client

Postby SaWey » 11:24am, Wed 14 Feb, 2007

Hi,

I've made a plugin that allows you to send emails from your home computer to your phplist server.

The only thing you have to do is go to your phpbb site and process the newly arrived messages.


This is now Bèta, and it would be nice if some people could test it and give me feedback.

Just download the plugin, extract it in the plugins folder and change 2 things in the mailtolist/get_email.class.php:
->path to attachments dir
->URL to attachments dir
Then it has to work.

Please feel free to give all kinds of feedback.
SaWey


Download here


[EDIT:] the download contains a new version,
please check the latest posts on how to make the changes.


A wiki page is available at http://docs.phplist.com/MailToList
Last edited by SaWey on 3:37pm, Thu 24 May, 2007, edited 3 times in total.
SaWey
PL Master
 
Posts: 192
Joined: 8:28pm, Wed 08 Mar, 2006
Location: Belgium

Postby Hernol » 7:26pm, Wed 14 Feb, 2007

I've made everything, but still no plugin...
Can you write some instructions of what it does and how to achieve that please ;)
Hernol
Admin
 
Posts: 1378
Joined: 6:39pm, Thu 18 May, 2006
Location: Argentina

Postby SaWey » 8:11pm, Wed 14 Feb, 2007

Do you have the default plugin enabled?
That's the one pointing to this one.

Try enabling that and see if it works.
SaWey
PL Master
 
Posts: 192
Joined: 8:28pm, Wed 08 Mar, 2006
Location: Belgium

Postby SaWey » 8:44pm, Mon 26 Feb, 2007

Again this plugin is updated,

we're almost getting to a final release.

To test this version, download is provided in the first post.


If you had the previous version installed, you will have to add some tables in phplist_popaccount:
Code: Select all
`queue` VARCHAR( 3 ) NOT NULL DEFAULT 'yes', `del_message` VARCHAR( 3 ) NOT NULL DEFAULT 'yes'


Here are the changes:

Priority high (really need to be fixed):
[fixed] -txt/php-attachments arent still recognized [/fixed]
[fixed]- all other attachments missing the filesize in the messageview [/fixed]
[fixed]- every message is categorized as multipart (text and html) even if it is only send as text or only as html [/fixed]
- mail with (not recognized) txt-attachment: html-messagetext isnt shown when editing message after queing (in Tinmce-Editor)


Priority middle (should be done):
- mail with zip-attachment: the texteditor (tinymce) shows the html-text. When send only with txt nothing is shown.
[fixed]- An option to delete settings rather than leaving the entries empty in the DB [/fixed]
[fixed=only one emailadress per list allowed]- when two lists have same mail-adress Handling now is: message is only send to the first list.[/fixed]
[fixed]-- Better: Either mail will be send to both lists or dont allow that two lists have same address.[/fixed]

Priority low (would be nice, but not necessary):
[fixed]- On clicking "Apply Settings" a message "settings have been saved" on the next screen.[/fixed]
[fixed]- A mail2list-settings-overview-page.[/fixed]
[fixed]- Status: "All 2 mails sent to listadress@mydomain.com
have been forwarded to <listname>." (So changing the text "phplist" to the corresponding listname)[/fixed]
[fixed]- better line breaks on "Mail to List Processing page" so that the different calls for each list are better separated. Perhaps a simple HR would do. [/fixed]
[NOT FIXABLE WITHOUT HARDCODING][* make images available inline (not linked to att dir)] [/NOT FIXABLE]
This can't be done because we can't write new headers for the email.
There has to be a lot of hardcoding in the main phplist code before this can be done.
I'll try to look at it when i have a lot of time.
[fixed][* ability to store messages without queuing them] [/fixed]
[in progress]- option for leaving messages on pop3. option for only fetch new mails. [/in progress]
SaWey
PL Master
 
Posts: 192
Joined: 8:28pm, Wed 08 Mar, 2006
Location: Belgium

Postby SaWey » 11:40pm, Wed 28 Feb, 2007

Another version has been released!!!

this time the sql-tables have changed, to be more independent of the phplist original tables.

If you had an old version installed, you will have to execute the following sql:


Code: Select all
-- -------------------------------------------
-- New SQL to input
-- Original config will be deleted!!!!!!
-- -------------------------------------------
ALTER TABLE `phplist_list` DROP `toemail` ,
DROP `template` ,
DROP `footer` ;
-- -------------------------------------------
-- -------------------------------------------
CREATE TABLE `phplist_mail2list_list` (`listid` INT( 10 ) NOT NULL PRIMARY KEY, `toemail` VARCHAR(255) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL, `template` INT( 10 ) NOT NULL , `footer` TEXT NOT NULL) ENGINE = innodb;
-- -------------------------------------------
-- -------------------------------------------
CREATE TABLE `phplist_mail2list_allowsend` (`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,`email` VARCHAR( 255 ) NOT NULL ,`name` VARCHAR( 255 ) NOT NULL ,`sent` INT( 50 ) NOT NULL DEFAULT '0') ENGINE = innodb;
-- -------------------------------------------
-- -------------------------------------------
CREATE TABLE `phplist_mail2list_popaccounts` (`listid` INT( 10 ) NOT NULL PRIMARY KEY, `host` VARCHAR( 255 ) NOT NULL ,`port` VARCHAR( 255 ) NOT NULL ,`login` VARCHAR( 50 ) NOT NULL ,  `pass` VARCHAR( 50 ) NOT NULL, `mail_status` VARCHAR( 10 ) NOT NULL DEFAULT '0/0', `queue` VARCHAR( 3 ) NOT NULL DEFAULT 'yes', `del_message` VARCHAR( 3 ) NOT NULL DEFAULT 'yes' ) ENGINE = innodb;
-- -------------------------------------------
-- -------------------------------------------
DROP TABLE `phplist_allowsend`, `phplist_popaccounts`;
-- -------------------------------------------



When executed, all old configuration will be gone.
SaWey
PL Master
 
Posts: 192
Joined: 8:28pm, Wed 08 Mar, 2006
Location: Belgium

plugin

Postby directfactory » 9:26pm, Thu 01 Mar, 2007

hi

As i understand this plugin is in order to send mails to my lists directly from my outlook.

Question : will the attachment be like in regular mail or they have to download from the server?

i don't know how to install this plugin.. so far i have extracted in but i don't know what to do next..

Please advise
directfactory
phpList newbie
 
Posts: 2
Joined: 6:23pm, Mon 05 Feb, 2007

Postby SaWey » 2:06am, Fri 02 Mar, 2007

Hi,

You can look at the wiki page, i think that should explain everything.

You can find it here

If you can't figure it out, let me know.
SaWey
PL Master
 
Posts: 192
Joined: 8:28pm, Wed 08 Mar, 2006
Location: Belgium

Postby flyinprogramer » 8:48pm, Tue 20 Mar, 2007

Ok, i'd just like to say, amazing plugin. I've got it set up, and i can "send" a message, but it only sends the footer, nothing i type in ever gets sent, my template doesn't get sent, nothing... other than the footer. You'd think it'd be a tmp directory problem. but i've tried EVERY combination of calling the folder that's there, and nothing works. Are there any settings in the phplist config that would conflict with the way this is setup? And suggestions?

Oh yeah, and i don't have this problem with phplist, and i tried using the same and different tmp directories, nothing seems to be working...

help... please!
flyinprogramer
phpList newbie
 
Posts: 2
Joined: 1:17pm, Tue 20 Mar, 2007

Postby SaWey » 10:19pm, Tue 20 Mar, 2007

Can you check your db and see if the mails are stored in there?

Are you sure you have configured everything right?

Grz
SaWey
PL Master
 
Posts: 192
Joined: 8:28pm, Wed 08 Mar, 2006
Location: Belgium

My Problem is solved!

Postby flyinprogramer » 3:05am, Wed 21 Mar, 2007

If you plan on using this plugin with Gmail, you're going to probably need to add this code to your get.email.class.php file in order to get it to work.

The Code:

#if plain text
if (strtoupper($p->subtype)=='PLAIN')1;
#if HTML
else if (strtoupper($p->subtype)=='HTML')1;
$this->partsarray[$i][text] = array('type'=>$p->subtype,'string'=>$part);

Where to add?

Right around line 270, after this:

if ($filename!='' ){

$this->partsarray[$i][attachment] = array('filename'=>$filename,'string'=>$part, 'encoding'=>$p->encoding,'part_no'=>$i,'type'=>$p->type,'subtype'=>$p->subtype);
}

(so find this ^, find the last } in this piece of code, press return, and then paste The Code)

That should fix her right up! Thanks again for all your help SaWay! By the way, SaWay coded this, not me, i'm just posting it to save him time. And since I did post it, technically i suppose this is an unofficial patch/work-around. So, no guarantees that it won't have any side affects (a.k.a. its possible this might break something, unlikely, but still possible).
flyinprogramer
phpList newbie
 
Posts: 2
Joined: 1:17pm, Tue 20 Mar, 2007

gmail erases the content

Postby mitchpc » 10:03pm, Mon 02 Apr, 2007

gmail erases the content
I made sure that the added codse you mentioned above is in plugin. But, it still does the same. Just footer. I have chose very simple template just with [CONTENT]
mitchpc
phpList newbie
 
Posts: 1
Joined: 9:59pm, Mon 02 Apr, 2007

Database Error

Postby blair.sawler » 7:23pm, Mon 30 Apr, 2007

Hi

I just installed Mail2List, am hoping to get it working. I get the following errors on the admin page when I go to configure it. Hope someone can help. Thanks!

Database error 1064 while doing query You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'COLLATE latin1_swedish_ci NOT NULL, `template` INT( 10 ) NOT NU

Database error 1064 while doing query You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ENGINE = innodb' at line 1

Database error 1064 while doing query You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ENGINE = innodb' at line 1
Database had to be updated, please reload the page.
blair.sawler
PL Nut
 
Posts: 21
Joined: 3:05pm, Sun 26 Nov, 2006

Postby SaWey » 10:20pm, Mon 30 Apr, 2007

Hey,

there's somethibg wrong with initiating the plugin.
I don't know what can cause this.

If you have access to phpMyAdmin or somthing like that, you can execute the following query to initialise the plugin:
(be sure to replace the 'phplist'-prefix of the tables if you use another prefix)
Code: Select all
-- Database: `phplist`
--

-- --------------------------------------------------------

--
-- Tabel structuur voor tabel `phplist_mail2list_allowsend`
--

CREATE TABLE `phplist_mail2list_allowsend` (
  `id` int(11) NOT NULL auto_increment,
  `email` varchar(255) NOT NULL,
  `name` varchar(255) NOT NULL,
  `sent` int(50) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;


--
-- Tabel structuur voor tabel `phplist_mail2list_list`
--

CREATE TABLE `phplist_mail2list_list` (
  `listid` int(10) NOT NULL,
  `toemail` varchar(255) NOT NULL,
  `template` int(10) NOT NULL,
  `footer` text NOT NULL,
  PRIMARY KEY  (`listid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


--
-- Tabel structuur voor tabel `phplist_mail2list_popaccounts`
--

CREATE TABLE `phplist_mail2list_popaccounts` (
  `listid` int(10) NOT NULL,
  `host` varchar(255) NOT NULL,
  `port` varchar(255) NOT NULL,
  `login` varchar(50) NOT NULL,
  `pass` varchar(50) NOT NULL,
  `mail_status` varchar(10) NOT NULL default '0/0',
  `queue` varchar(3) NOT NULL default 'yes',
  `del_message` varchar(3) NOT NULL default 'yes',
  PRIMARY KEY  (`listid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;


If this works, try to add a user to the whitelist, if that doesn't work please post your errors here.

Grz
SaWey
SaWey
PL Master
 
Posts: 192
Joined: 8:28pm, Wed 08 Mar, 2006
Location: Belgium

Postby blair.sawler » 11:48pm, Mon 30 Apr, 2007

I wondered how the db was being updated! Thanks will give that a try and let you know.
blair.sawler
PL Nut
 
Posts: 21
Joined: 3:05pm, Sun 26 Nov, 2006

Postby blair.sawler » 11:58pm, Mon 30 Apr, 2007

HI there. I got errors when importing tge script: :(

Running phpMyAdmin 2.7.0-pl2 and MySQL 4.0.16

Here is the result.


SQL query:

Code : -- Database: `phplist`
--
-- --------------------------------------------------------
--
-- Tabel structuur voor tabel `phplist_mail2list_allowsend`
--
CREATE TABLE `phplist_mail2list_allowsend` (

`id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`email` varchar( 255 ) NOT NULL ,
`name` varchar( 255 ) NOT NULL ,
`sent` int( 50 ) NOT NULL default '0',
PRIMARY KEY ( `id` )
) ENGINE = InnoDB DEFAULT CHARSET = latin1 AUTO_INCREMENT =3;



MySQL said:

#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Code:

CREATE TABLE `phplist_mail2list_allowsend` (
blair.sawler
PL Nut
 
Posts: 21
Joined: 3:05pm, Sun 26 Nov, 2006

Next

Return to Contributions: Plug-ins, Add-ons, Mods

Who is online

Users browsing this forum: No registered users and 0 guests