I used the following code to confirm users subscription by sending them email.
<?php
$id = $row_rsSubscriber['ID'];
$to = $row_rsSubscriber['SubEmail'];
$subject = "Subscription confirmation";
$body = "<html><body>" .
"<h2>Thank you for subscribing to our newsletter!</h2>" .
"<p>To unsubscribe, click <a href=\"http://www.eurosicons.com/sub_unsub/con ... be.php?ID=" .
$id . "\">here</a>.</p>" . "</body></html>";
$headers = "From: Subscription Manager <stunningly@stunninglygorgeous.com>\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-type: text/html; charset=UTF-8";
if (!mail($to, $subject, $body, $headers)) {
header( 'Location: http://www.eurosicons.com/sub_unsub/error_subscribe.php' ) ;
}
?>
I received error saying that the mail function is not working properly.
I couldn't see what is wrong with the code
Please help !
Subscription
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Subscription
arborint wrote:What is the error message?
I am building a subscribe/unsubscribe app in PHP with Dreamweaver CS3.
I am following step by step the article on
http://www.adobe.com/devnet/dreamweaver ... h_php.html
On page 4 of this article, I used the following code:
<?php
$id = $row_rsSubscriber['ID'];
$to = $row_rsSubscriber['SubEmail'];
$subject = "Subscription confirmation";
$body = "<html><body>" .
"<h2>Thank you for subscribing to our newsletter!</h2>" .
"<p>To unsubscribe, click <a href=\"http://www.eurosicons.com/sub_unsub/con ... be.php?ID=" .
$id . "\">here</a>.</p>" . "</body></html>";
$headers = "From: Subscription Manager <amanda099@gmail.com>\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-type: text/html; charset=UTF-8";
if (!mail($to, $subject, $body, $headers)) {
header( 'Location: http://www.eurosicons.com/sub_unsub/error_subscribe.php' ) ;
}
?>
When I test the application ( publishing the pages to my web server, going to subscribe.php and entering my e-mail address ) , I was taken to the error page: http://www.eurosicons.com/sub_unsub/error_subscribe.php
According to Joseph Lowery (the one who wrote the article ), the e-mail function in the above code didn't work properly.
Please help !
Amanda Nguyen