Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
1e46ef1e
Commit
1e46ef1e
authored
20 years ago
by
Rodolphe Quiedeville
Browse files
Options
Downloads
Patches
Plain Diff
Nouveau fichier
parent
f7abd56c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/mailing-send.php
+120
-0
120 additions, 0 deletions
scripts/mailing-send.php
with
120 additions
and
0 deletions
scripts/mailing-send.php
0 → 100644
+
120
−
0
View file @
1e46ef1e
<?PHP
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
* $Source$
*
*
* Export simple des contacts
*
* L'utilisation d'adresses de courriers lectroniques dans les oprations
* de prospection commerciale est subordonne au recueil du consentement
* pralable des personnes concernes.
*
* Le dispositif juridique applicable a t introduit par l'article 22 de
* la loi du 21 juin 2004 pour la confiance dans l'conomie numrique.
*
* Les dispositions applicables sont dfinies par les articles L. 34-5 du
* code des postes et des tlcommunications et L. 121-20-5 du code de la
* consommation. L'application du principe du consentement pralable en
* droit franais rsulte de la transposition de l'article 13 de la Directive
* europenne du 12 juillet 2002 Vie prive et communications lectroniques .
*/
require
(
"../htdocs/master.inc.php"
);
require_once
(
DOL_DOCUMENT_ROOT
.
"/lib/dolibarrmail.class.php"
);
$error
=
0
;
$sql
=
"SELECT m.rowid, m.titre, m.sujet, m.body"
;
$sql
.
=
" , m.email_from, m.email_replyto, m.email_errorsto"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"mailing as m"
;
$sql
.
=
" WHERE m.statut = 2"
;
$sql
.
=
" LIMIT 1"
;
if
(
$db
->
query
(
$sql
)
)
{
$num
=
$db
->
num_rows
();
$i
=
0
;
if
(
$num
==
1
)
{
$obj
=
$db
->
fetch_object
();
dolibarr_syslog
(
"mailing-send: mailing
$row[0]
"
);
dolibarr_syslog
(
"mailing-send: mailing module
$row[1]
"
);
$id
=
$obj
->
rowid
;
$subject
=
$obj
->
sujet
;
$message
=
$obj
->
body
;
$from
=
$obj
->
email_from
;
$errorsto
=
$obj
->
email_errorsto
;
$i
++
;
}
}
$sql
=
"SELECT mc.nom, mc.prenom, mc.email"
;
$sql
.
=
" FROM "
.
MAIN_DB_PREFIX
.
"mailing_cibles as mc"
;
$sql
.
=
" WHERE mc.fk_mailing = "
.
$id
;
if
(
$db
->
query
(
$sql
)
)
{
$num
=
$db
->
num_rows
();
$i
=
0
;
dolibarr_syslog
(
"mailing-send: mailing
$num
cibles"
);
while
(
$i
<
$num
)
{
$obj
=
$db
->
fetch_object
();
$sendto
=
stripslashes
(
$obj
->
prenom
)
.
" "
.
stripslashes
(
$obj
->
nom
)
.
"<"
.
$obj
->
email
.
">"
;
$mail
=
new
DolibarrMail
(
$subject
,
$sendto
,
$from
,
$message
);
$mail
->
errors_to
=
$errorsto
;
if
(
$mail
->
sendfile
()
)
{
}
$i
++
;
}
}
else
{
dolibarr_syslog
(
$db
->
error
());
}
?>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment