Sending an email to subscribers

the mail() function

Moderators: macek, egami, gesf

benedict3578
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

Hi,
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==========
<?php
session_start();

include('config.php');

include('classes/class.mysql.php');
include('classes/class.user.php');

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

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

$user->destroyAuthorization();

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]-->

<head>

<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>

</head>

<body>

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

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

<div id="admin-dialog">

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

<h1>Notification email</h1>

</div>

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

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

<fieldset>

<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>

</form>

</fieldset>

</div>

<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>

</div>

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

</div>

</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>

<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>

<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>

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

Invalid username and/or password. Please try again.

</div>

</div>

</div>

</form>

</div>

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

</div>

</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="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></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-->

</body>

</html>
==========Code End==========

User avatar
egami
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?

benedict3578
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

cron