Subscription

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
Dean099
Forum Newbie
Posts: 3
Joined: Mon Jul 07, 2008 7:55 am

Subscription

Post by Dean099 »

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 !
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Subscription

Post by Christopher »

What is the error message?
(#10850)
Dean099
Forum Newbie
Posts: 3
Joined: Mon Jul 07, 2008 7:55 am

Re: Subscription

Post by Dean099 »

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