Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 4th, 2003, 01:01 PM
Authorized User
Join Date: Jun 2003
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default mailing list using php

Hello all,

I have created a mailing list that will take a persons name, email and send a copy to myself and also send a copy of the email to them thanking them for joining or subscribing to the list.

Now the question that I have is, I do not want to receive the same email as the user(which is the thank you for joing email) all I want is the username and email. The only reason why I receive the same email is because I have my address as the bcc:. Here is the code.

<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr><td width="10%"> </td>
        <td width="80%">
        <h1 align="center">Thank you!</h1>
      <p align="center"> We've received your request to join our
        mailing list for <? echo ("<b>".$status."</b>"); ?>.<br>
        Please <a href="index.html">click here</a> to return to the home page.</p>
$recipient .= $email;
$subject = $status. " Mailing list";

//$message .= "<h3>From: ".ucwords(strtolower($name))."</h3>"; Remove comment if you would like to see the applicant's name on email
$message .= "<table border='0'><tr><td>Dear ".$name.", <br>Thank you for joining our ".$status." mailing list.<Br> Hope you like it.</td></tr><tr><td>Please confirm your e-mail address is correct, if not please re-submit your request with the correct e-mail address.<br><a href='mailto:".ucwords(strtolower($name)).rawurlen code(" <").strtolower($email).rawurlencode(">")."?subject =Re:%Mailing%list%'>Email: ".strtolower($email)."</a></td></tr> \n";
$message .= "<tr><td><BR><BR><b>This is an automated response, please do not reply to this message</b></td></tr></table> \n";

$message .= "<tr><td><b>Comments:</b> ".$comments."</td></tr></table>\n";

$headers .= "From: ".$Name." <".strtolower($email).">\n";
$headers .= "bcc: <my email address>\n";
$headers .= "X-Sender: <my email address>\n";
$headers .= "X-Mailer: PHP\n"; // mailer
$headers .= "X-Priority: 1\n"; // Urgent message!
$headers .= "Return-Path: <my email address>\n"; // Return path for errors

/* If you want to send html mail, uncomment the following line */
$headers .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime type

mail($recipient, $subject, $message, $headers);
        <td width="10%"> </td>

The code is actually workign wonderfully, I just want ideas on how I can avoid getting the same email as the user.
if anyone can help me I would greatly appreciate it, and thank you.
Old June 4th, 2003, 02:50 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn

You have to call again mail function event without headers info (if you want only user/email info from user).
par example:
mail($your_email_address, "Mailing list's username/email values", $message);

$message="Email:" . $email . "\n";
$message.="Username:" . $username ."\n\n";




...but the Soon is eclipsed by the Moon

Similar Threads
Thread Thread Starter Forum Replies Last Post
About Mailing List ssomchai BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 May 5th, 2008 10:05 PM
Mailing List Carriemh Beginning PHP 2 September 2nd, 2006 07:17 AM
Add Mailing List Problem USADarts BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 August 11th, 2004 10:19 PM
Newsletter Mailing List Manager PySpencer Beginning PHP 6 December 21st, 2003 07:13 PM
Mailing list module has error - HELP drfunkie BOOK: ASP.NET Website Programming Problem-Design-Solution 3 September 8th, 2003 12:09 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.