Thanks bionoid, sendmail.php code tidied up but I have not taken that further yet...!
Have set up a test Subscribe link facility on the index.php page.
Presenting these last few .php file pages in package for review:
Placing them all together as my internet link remains poor this morning.
This is the thanks.php page code:
PHP Code:
<html><head> <title>Thanks You Page</title> </head><body> <?php
$Body = readfile("data/autoresponder.txt"); mail("$Email","Welcome to my mailing list!", "$Body","From: Me\nReply-To: me@myaddress.com"); $myfile = file("data/mylist.lst"); $fh = fopen("data/mylist.lst","a"); for ($index=0; $index < count($myfile); $index++) { if ($Email != chop($myfile[$index])) {fputs($fh,$myfile[$index]);} } fputs($fh,$Email."\n"); fclose($myfile);
?> Thank you! <br><br> <a href="index.php">Back to Home Page</a>. </body></html>
the autoresponder.php code
PHP Code:
<html><head><title>Edit Autoresponder Messages</title></head><body> <form method="post" action="writeautoresponder.php"> <br /> <h3>Autoresponder Message</h3> This is the automatic message that will be sent<br /> to people who have submitted their Email address <br /> to the mailing list. <br><br> <textarea cols="40" rows="10" name="Body"> <?php
readfile("data/autoresponder.txt");
?> </textarea> <br><br> <input type="submit" name="submit" value="Save This Auto Message"></FORM> <br><br><a href="addnames.php">Add E-mails to a list</a>. <br><br><a href="data/log.txt">View the Send Log</a>. <br> </body></html>
and the writeautoresponder.php
PHP Code:
<html><head> <title>Updating file....</title> </head><body> <br><br> <b>The following autoresponder message has been saved:</b><br> <?php
On the server it does not add to list..! Advises of 500 internal error. This page seems almost identical to the saveemail.php that works when inputting emails from the Admin Panel.
Why does this not work in the new situation and is this approach proper use of logic on my behalf??
This is not always fun! Yes, now resolved the issue with the missing line in the subscribe.html and thing performed as required sending sample subscribed emails to the List. Yes, there is a reason for everything.
When installing message in autoresponder.php it gets processed by the writeautoresponder.php. In my trials it will not save to the autresponder.txt...!
I have tried different things including the a, the w and $Body = $_POST('Body'); all to no effect...!
This is the autoresponder.php
PHP Code:
<?php
readfile("data/autoresponder.txt");
?>
and this is the writeautosponder.php
PHP Code:
<b>The following autoresponder message has been saved:</b><br>
<?php
Having a problem grasping the logic. No, I did not have anything to drink over the New Year. Happy New Year. Back to the logic bit!
Firstly, When a visitor submits an email address it is written to the List with the writesubscription.php I was of the opinion that a message would then be sent to the visitors email address from the autoresponder facility and that this would happen automatically after the visitor submitted the email address.! Is this correct thinking in respect of the autoresponder facility and how would/is same activated?
Secondly, I had formed the opinion that I was now at the point where using the index.php page that I could send a test message (as in a update) to the emails in the email list..! The test message is subject to processing by the sendmail.php but nothing only a 404 gets delivered!
Bookmarks