E-mail

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
destructivetitan
Forum Newbie
Posts: 2
Joined: Tue Jan 06, 2009 2:44 pm

E-mail

Post by destructivetitan »

Well here is my dilemna i would like to know if there is any way that an email will be sent automatically to someone or a group of people without need for confirmation or anything at all.

I have made a few attempts to use SMTP but i am pretty sure i am not understanding that concept as a whole.

The mail feature is not working (probably cause i don't understand SMTP) and the mailto: is the only thing that works but as stated above i have no need for the user to confirm or press send on the email.

Basically the user is taking a test and the score is sent to the user via email. I need it automatically sent so the user has no way of accidentally pressing close and the email terminated.

Any Help would be appreciated.!

:banghead:
nvartolomei
Forum Newbie
Posts: 11
Joined: Tue Jan 06, 2009 3:46 pm

Re: E-mail

Post by nvartolomei »

mail() function is enabled?
if is enabled you can send email using mail function. Chek this: http://md.php.net/manual/en/book.mail.php#86360
destructivetitan
Forum Newbie
Posts: 2
Joined: Tue Jan 06, 2009 2:44 pm

Re: E-mail

Post by destructivetitan »

How would you check that?
If you do that through php.ini then it is already done (or atleast how my coworker interpreted it) but there are still no emails being sent.

Code: Select all

 
<?
$to = "blah@blah.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
$to = "blah1@blah.com";
$subject = "TESTING";
$msg = "Now!";
mail("$to", "$subject", "$msg");
if (mail("$to", "$subject", "$msg")) {
echo("<p>finished!</p>");
} else {
echo("<p>Message delivery failed...again</p>");
}
$to = "blah2@blah.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
mail($to,$subject,$message);
if (mail($to,$subject,$message)) {
echo("<p> Mail Sent!</p>");
} else {
echo("<p>Message delivery failed...again...again</p>");
}
?>
<a href="mailto:blah3@blah.com?body=The message's first paragraph.%0A%0aSecond paragraph.%0A%0AThird Paragraph.">BLAH3@BLAH.COM</a>
<?
$adminemail = "blahadmin@blah.com";
$subj = "Hello";
$msg = "Goodbye";
echo "$adminemail";
 
mail($adminemail, $subj, $msg, "From: $name <$from>\r\nReply-to: $from\r\nContent-type: text/html; charset=iso-8859-1\r\n"); 
if (mail($adminemail, $subj, $msg, "From: $name <$from>\r\nReply-to: $from\r\nContent-type: text/html; charset=iso-8859-1\r\n")) {
echo("<p> Sent to Blah</p>");
} else {
echo("<p>Message delivery failed...again...again...WOW</p>");
}
?>
 
Those are some different variations (if variations at all) i have used and all of them echo back SENT and not one is recieved! Any advice i have a feeling it is a little slipup i cant see so... please any help would be nice!

P.S. the mailto: works but dont need it!
Post Reply