Sending an email to subscribers

the mail() function

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 4
Joined: Mon Feb 20, 2012 5:20 am

Sending an email to subscribers

Postby benedict3578 » Mon Feb 20, 2012 5:26 am

I have set up this script to send messages to emails stored in a mysql database, if I am logged using an email and password from another database. This is the code, but when the emails arrive, there is no sender email, name, subject or message. Can anyone help? :help: :help: :help: :help: :(

==========Code Start==========



$mysql = new Mysql($dbHost, $dbUser, $dbPass, $dbName);
$user = new User($mysql);

if(isset($_GET['l'])) {


header('location: ./');

<!DOCTYPE html>

<!--[if lt IE 7]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->


<meta charset="utf-8">

<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
Remove this if you use the .htaccess -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<title>Notification Email</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- CSS: implied media="all" -->
<link rel="stylesheet" href="resources/css/clear.css">
<link rel="stylesheet" href="resources/css/style.css">
<link rel="stylesheet" href="resources/css/smoothness/jquery-ui-1.8.13.custom.css">

<!-- All JavaScript at the bottom, except for Modernizr which enables HTML5 elements & feature detects -->
<script src="resources/js/libs/modernizr.js"></script>



<?php if($user->isAuthorized()) { ?>

<div id="admin-dialog-wrap">

<div id="admin-dialog">

<div id="admin-dialog-header">

<h1>Notification email</h1>


<div id="admin-dialog-box">

<div id="admin-dialog-content">


<form action="" method="post" id="notify">

<label for="sender-name">Name of sender:</label>
<input type="text" name="sender-name" id="sender-name" class="text-input required" />

<label for="sender-email">Email of sender:</label>
<input type="text" name="sender-email" id="sender-email" class="text-input required email" />

<label for="subject">Subject:</label>
<input type="text" name="subject" id="subject" class="text-input required" />

<label for="message">Message:</label>
<textarea name="message" id="message" class="required"></textarea>




<div id="admin-dialog-footer">

<div id="admin-dialog-footer-processing-wrap"></div>

<input type="submit" name="submit-login" value="Send notification email" class="submit-button" onclick="$('#notify').submit();" />



<div class="log-in-dialog-copyright"><a href="?l">Log out</a></div>



<?php } else { ?>

<div id="log-in-dialog-wrap">

<div class="log-in-dialog">

<div class="log-in-dialog-header">

<h1>Fusion Setup Wizard</h1>


<div class="log-in-dialog-box">

<form method="post" action="" id="login">

<div class="log-in-dialog-content">

<label for="username">Username:</label>
<input type="text" name="username" id="username" class="text-input" />

<label for="password">Password:</label>
<input type="password" name="password" id="password" class="text-input" />


<div class="log-in-dialog-footer">

<div class="log-in-dialog-footer-states clearfix">

<div class="log-in-dialog-footer-state submit">

<input type="submit" name="submit-login" value="Login" class="submit-button" />


<div class="log-in-dialog-footer-state error">

Invalid username and/or password. Please try again.






<div class="log-in-dialog-copyright">Copyright TECHnet ©2012 - All rights reserved</div>



<?php } ?>

<!-- JavaScript at the bottom for fast page loading -->

<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if necessary -->
<script src="//"></script>
<script>window.jQuery || document.write("<script src='resources/js/libs/jquery.js'>\x3C/script>")</script>

<!-- scripts concatenated and minified via ant build script-->
<script src="resources/js/libs/jqueryui.js"></script>
<script src="resources/js/timepicker.js"></script>
<script src="resources/js/validate.js"></script>
<script src="resources/js/plugins.js"></script>
<script src="resources/js/script.js"></script>
<!-- end scripts-->


==========Code End==========

User avatar
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Sending an email to subscribers

Postby egami » Mon Feb 20, 2012 5:35 am

Where's the actual PHP code that does the mailing?

New php-forum User
New php-forum User
Posts: 4
Joined: Mon Feb 20, 2012 5:20 am

Re: Sending an email to subscribers

Postby benedict3578 » Mon Feb 20, 2012 5:49 am

to be honest, i don't really understand this. I will send you the login for a ftp account, and you can have a look.

Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 1 guest