Dear sir,
I want NEWSLETTER in PHP i send newsletter in HTM page how to send pleas can u help any one.
Regards
A. Jaya prakash
12 3274
Dear sir,
I want NEWSLETTER in PHP i send newsletter in HTM page how to send pleas can u help any one.
Regards
A. Jaya prakash
I use a simple newsletter based on SwiftMailer, but there should be lots of sample scripts around ( google)
thanks for your reply
I am working in php new i didn't coading but i want send my website to goto html page all mails how to send i will send here my working pages http://www.aidindia.org.uk/mailer/sendmail.html
pleas help any newslette sent to html file subribers full coading i want
Regards
A. Jaya prakash
dear sir i want newsletter no database in PHP if u have send me my mail adddress <email removed>
I have not, but google has.
Listen aajayaprakash, we are not going to send you anything. If you want someone to make you a script, you can hire someone. We're all volunteers around here and if I want someone barking at me that I should write something, I'll just listen to my boss.
Now, you've got two options. You can either try to start writing something yourself and ask us if you're stuck on something, or you can try another forum or article library on the internet. It's you're choice, but stop asking us for full code.
Steven
Thanks for reply
I have given coad but not working wnat can i do pleas sugustion soon
newsletter.php - <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
<html xmlns="http://www.w3.org/1999/xhtml">
-
<head>
-
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
-
<title>Send Newsletter System (SNS)</title>
-
-
<script language="JavaScript" type="text/javascript"><!--
-
function validate_form(form)
-
{
-
with (form)
-
{
-
if ((form.file.value)=="") {
-
alert( "The Send e-mail list must be filled!" );
-
form.file.focus();
-
return false ;
-
}
-
return true;
-
}
-
}
-
//-->
-
</script>
-
<style type="text/css">
-
<!--
-
.style1 {
-
color: #FFFFFF;
-
font-weight: bold;
-
}
-
.style2 {font-family: Arial, Helvetica, sans-serif}
-
-->
-
</style>
-
</head>
-
<body>
-
<?php
-
if($_GET["attachment"]!=""){
-
$NumberOfAttachment=$_GET["attachment"];
-
$subject=$_GET["subject"];
-
}else{
-
$NumberOfAttachment=1;
-
}
-
?>
-
<form action="./send_newsletter.php" method="post" enctype="multipart/form-data" name="newsletter" onSubmit="return validate_form(this)">
-
<table width="733" border="1" align="center">
-
<tr bgcolor="#99FFFF">
-
<td colspan="3" bgcolor="#003366"><div align="center">
-
<h1 class="style1">AIDINDIA Newsletter</h1>
-
</div></td>
-
</tr>
-
<tr bgcolor="#FFFFCC">
-
<td bgcolor="#99CCCC"> </td>
-
<td colspan="2" bgcolor="#99CCCC"><span class="style2">**Please confirm your attached file firstly. </span></td>
-
</tr>
-
<tr bgcolor="#FFFFCC">
-
<td bgcolor="#99CCCC"><strong>Attached file: </strong>** </td>
-
<td colspan="2" bgcolor="#99CCCC"><label>
-
<input name="nuOfAttachment" type="hidden" value="<?=$NumberOfAttachment?>" />
-
<?php
-
for($i=$NumberOfAttachment;$i>0;$i--){
-
?>
-
<input type="file" name="attachment<?=$i?>">
-
<?php
-
}
-
$NumberOfAttachment++;
-
?>
-
<input name="Addattachment" type="button" onclick="location.href='newsletter.php?attachment=<?=$NumberOfAttachment?>'" value="Add attachment" />
-
</label></td>
-
</tr>
-
<tr bgcolor="#FFFFCC">
-
<td width="152" bgcolor="#99CCCC"><strong>Email Subject:</strong> </td>
-
<td colspan="2" bgcolor="#99CCCC"><label>
-
<input name="subject" type="text" size="60" />
-
</label></td>
-
</tr>
-
<tr bgcolor="#FFFFCC">
-
<td width="152" bgcolor="#99CCCC"><strong>Email Body: </strong></td>
-
<td colspan="2" bgcolor="#99CCCC"><label>
-
<textarea name="email_body" cols="60" rows="10" ></textarea>
-
</label></td>
-
</tr>
-
<tr bgcolor="#FFFFCC">
-
<td bgcolor="#99CCCC"><strong>Send e-mail list:</strong> * </td>
-
<td colspan="2" bgcolor="#99CCCC"><label>
-
<input name="file" type="file" size="30" />
-
*</label></td>
-
</tr>
-
<tr bgcolor="#FFFFCC">
-
<td bgcolor="#99CCCC"> </td>
-
<td width="224" bgcolor="#99CCCC"><label>
-
<input type="submit" name="Submit" value="Send Newsletter" />
-
</label></td>
-
<td width="335" bgcolor="#99CCCC"><input type="button" name="Submit2" value="Reset" onClick="location.href='newsletter.php'" /></td>
-
</tr>
-
</table>
-
</form>
-
</body>
-
</html>
-
-
-
sendnewsletter.php
-
-
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
<html xmlns="http://www.w3.org/1999/xhtml">
-
<head>
-
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
-
<title>Send Newsletter System(SNS)</title>
-
<style type="text/css">
-
<!--
-
.style1 {
-
color: #FFFFFF;
-
font-weight: bold;
-
}
-
-->
-
</style>
-
</head>
-
-
<body>
-
-
<style type="text/css">
-
<!--
-
.style3 {color: #FF0000}
-
-->
-
</style><table width="733" border="1" align="center">
-
<tr bgcolor="#CC6633">
-
<td colspan="3" bgcolor="#003366"><div align="center">
-
<h1 class="style1">AIDINDIA Newsletter</h1>
-
</div></td>
-
</tr>
-
<tr bgcolor="#99CCCC">
-
<td><strong>Attached file:</strong></td>
-
<td colspan="2">
-
<?php
-
$var_nuOfAttachment=$nuOfAttachment;
-
while($var_nuOfAttachment>0){
-
?>
-
<?=$_FILES["attachment$var_nuOfAttachment"]["name"]?>
-
<br />
-
<?php
-
$var_nuOfAttachment--;
-
}
-
?>
-
</td>
-
</tr>
-
<tr bgcolor="#99CCCC">
-
<td><strong>Email Subject: </strong></td>
-
<td colspan="2"><?=$subject?></td>
-
</tr>
-
<tr bgcolor="#99CCCC">
-
<td><strong>Email Body:</strong></td>
-
<td colspan="2"><?=$email_body?></td>
-
</tr>
-
<tr bgcolor="#99CCCC">
-
<td width="169"><strong>Have been Sent email to:</strong> </td>
-
<td width="548" colspan="2"><label>
-
-
<?php
-
#Program:
-
# This program can let staff to send newsletter by email list.
-
#
-
#History:
-
#19June2008 FFan Version 1.1
-
#
-
#Version 1.0 send newsletter.
-
#Version 1.1 the email content can be html.
-
#Versoin 1.1 the uploaded email list can overwrite exist one.
-
#Please send email to me fanpingchun@hotmail.com when you think it can improve anymore.
-
#Thank you so much~~Hope u enjoy it.
-
-
########################Define the smtp server,port number and send from################################
-
ini_set("SMTP","smtp.mail.yahoo.com");
-
ini_set("smtp_port","25");
-
$from="aajayaprakash@yahoo.com"; ########################################################################################################
-
-
#read text file for send newsletter list
-
if ($_FILES["file"]["name"] =="")
-
{
-
echo "No sent email list!";
-
}
-
elseif ($_FILES["file"]["error"] > 0)
-
{
-
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
-
}
-
else
-
{
-
//if (file_exists("upload/" . $_FILES["file"]["name"]))
-
//{
-
// echo "Warming! The ". $_FILES["file"]["name"]." Send e-mail list has already exists. Please change the Send e-mail list name and send newsletter again.";
-
// echo "<br>"."The newsletter has not been sent!";
-
//}
-
//else
-
if(1>0)
-
{
-
move_uploaded_file($_FILES["file"]["tmp_name"],
-
"upload/" . $_FILES["file"]["name"]);
-
echo "The ". $_FILES["file"]["name"]." Send e-mail list has been stored in server successfully. ";
-
-
-
echo "<br>";
-
$file = "upload/" . $_FILES["file"]["name"];
-
$f = fopen($file, "r");
-
while ( $line = fgets($f, 100000) ) {
-
$num++;
-
$to = "$line";
-
if($_FILES["attachment$nuOfAttachment"]["name"]!=""){
-
############### Attached file function#################
-
$boundary = uniqid( "");
-
# make the email headers
-
$headers = "From: $from
-
Content-type: multipart/mixed; boundary=\"$boundary\"";
-
$body = "--$boundary
-
Content-type: text/html; charset=iso-8859-1
-
Content-transfer-encoding: 8bit
-
-
$email_body
-
-
";
-
for($var_nuOfAttachment=1;$var_nuOfAttachment<=$nuOfAttachment;$var_nuOfAttachment++){
-
//echo $var_nuOfAttachment;
-
# check the upload file type
-
if ($_FILES["attachment$var_nuOfAttachment"]["type"]) $mimeType = $_FILES["attachment$var_nuOfAttachment"]["type"];
-
# in case no file type then set to unknown
-
else $mimeType = "application/unknown";
-
-
# create the name of the file
-
$fileName = $_FILES["attachment$var_nuOfAttachment"]["name"];
-
-
# read the file
-
$fp = fopen($_FILES["attachment$var_nuOfAttachment"]['tmp_name'] , "r");
-
-
# convert it
-
$read = fread($fp, filesize($_FILES["attachment$var_nuOfAttachment"]['tmp_name']));
-
$read = base64_encode($read);
-
$read = chunk_split($read);
-
-
# make the email body
-
$body =$body."--$boundary
-
Content-type: $mimeType; name=$fileName
-
Content-disposition: inline; filename=$fileName
-
Content-transfer-encoding: base64
-
-
$read
-
-
";
-
-
}
-
$body =$body."--$boundary--";
-
//echo $body;
-
#########################################################
-
-
# send email one by one
-
mail($to, $subject, $body, $headers);
-
}else{
-
$headers = "From: $from";
-
##################################################################################################################
-
$headers = "From: $from
-
MIME-Version: 1.0
-
Content-type: text/html; charset=iso-8859-1";
-
$html_email_body = "
-
$email_body
-
";
-
#############################################################################
-
mail($to, $subject, $html_email_body, $headers);
-
}
-
############### Attached file function#################
-
echo "The newsletter has sent to ";
-
echo "<span class=style3>";
-
echo "$line";
-
echo "</span>";
-
echo "<br>";
-
}
-
}
-
}
-
?>
-
-
</label></td>
-
</tr>
-
<tr bgcolor="#99CCCC">
-
<td> </td>
-
<td colspan="2"><input type="button" name="Submit2" value="Return Main" onClick="location.href='index.php'" /></td>
-
</tr>
-
</table>
-
-
</body>
-
</html>
I upload but not working
what can i do Pleas send reply soon regards
A. Jaya prakash
i want html file send to email from PHP coading pleas help me
Do you want us to guess what part is not working? Or do you expect us to read 282 lines of code to see what is wrong? Try to specify what part is not working. Perhaps the person who gave you this code can tell you what is wrong?
Steven
side note: I find SwiftMailer very comfotable (especially when it come to html mails) and easy to implement (plus they have quite an impressive documentation).
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jeremy Ross |
last post by:
Hello,
We are looking for a Newsletter Program that is tested and is knowing to
work with PHP/MySQL. We will be having allot of people use this
newsletter so it should be able to handle sending...
|
by: Pilu |
last post by:
Hi, I have to send a newsletter to more then 8000 address!
What is the best way to do it?
sending all together?, with mail() function?, with smtp?, divided in
groups....???
tnx so much!
|
by: Nis Sarup |
last post by:
A customer of mine wants to make a newsletter for their website. The
newsletter should be HTML with images and sent to a database of her
subscribers.
They would like a script where they can easily...
|
by: cooldv |
last post by:
i have an *access database + ASP newsletter* that is working fine and
it sends newsletter to ALL the email addresses in the DB.
i want to send this newsletter to only a select group (like people...
|
by: Neven |
last post by:
Hi,
Is there a trick how to use CSS in newsletters ?
I'm trying to use CSS formating when creating newsletter, but when i recieve
CSS newsletter, no CSS formating is visible, all the text is...
|
by: sylvain |
last post by:
http://groups.yahoo.com/group/HiTechUnited (Source of articles about
the HiTech Underemployment Crisis)
HiTechUnited is a weekly newsletter, delivered Mondays, written by and
for...
|
by: Michel Couche |
last post by:
Hello,
I am starting the development of a newsletter
The use of the class MailMessage of System.Net.Mail is quite straightforward for usual contact forms but my question here is "How can I...
|
by: neopersia |
last post by:
hello
I'm designing a newsletter for my site and I gonna send my newsletters using mail() function.
I want each user that receives newsletter be able to see just his email address in "TO" field and...
|
by: ginoplusio |
last post by:
Hi,
I'm developing a software to send newsletter to the users of my
website. I have a problem on the stats, detecting the opening of the
newsletter on the user's client.
The method I've chosen...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |