Jump to content

Needin help with Email confirmation


Beta4

Recommended Posts

Hello all names Beta4,

I do apologize in advance if I am posting this in the wrong area.

Im still kinda a newbie

 

Anyhow, I want to allow the user to post data such as user name, email, and description on a generic post, this is for a project not commercial use.

 

I want it to display a confimation with the users name, email and description on what he or she posted.

Then I want an email sent to their email with the same information that displays the confirmation after they hit the submit button.

This is the code I have. Thanks again all!

 

post.php is the name of the file I have given it.

 

<html>

 

<head>

<title>Post</title>

 

</head>

 

<body>

<h2>Post</h2>

 

<?php

$user = $_POST['user'];

$email = $_POST['email'];

$description = $_POST['description'];

 

$to = $_POST['email'];

$subject = 'Confirmation on your recent post at the Trading Post';

$msg = "Your name is $user and your email is $email\n" .

"Your post reads: $description\n";

$header = "From: admin@mothinrelay.com";

 

mail($to, $subject, $msg, $header);

 

echo 'Your post has been submitted.<br />';

echo 'Your user name is ' . $user . '<br />';

echo 'Your email is ' . $email . '<br />';

echo 'You post reads: ' . $description . '<br />';

?>

 

</body>

 

</html>

Link to comment
Share on other sites

What does it output?

Did you check your junk mail?

Are you hosting this or using a paid host? Do they have a mail server? Does mail() return true or false?

 

A third-party library like PHPMailer might help in the long run.

Link to comment
Share on other sites

So how would i change that if my php.ini looks like this:

 

[mail function]

; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury

; SMTP = localhost

; smtp_port = 25

 

; For Win32 only.

; http://php.net/sendmail-from

;sendmail_from = postmaster@localhost

 

; XAMPP IMPORTANT NOTE (1): If XAMPP is installed in a base directory with spaces (e.g. c:\program filesC:\xampp) fakemail and mailtodisk do not work correctly.

; XAMPP IMPORTANT NOTE (2): In this case please copy the sendmail or mailtodisk folder in your root folder (e.g. C:\sendmail) and use this for sendmail_path.

 

; XAMPP: Comment out this if you want to work with fakemail for forwarding to your mailbox (sendmail.exe in the sendmail folder)

;sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

 

; XAMPP: Comment out this if you want to work with mailToDisk, It writes all mails in the C:\xampp\mailoutput folder

sendmail_path = "C:\xampp\mailtodisk\mailtodisk.exe"

Link to comment
Share on other sites

Anyone care to help? I just dont want to do something that will mess it up, cause if you mess with the php.ini - i have had an experience before where you mess it up, it wont work properly even if you change back to what it was.

 

Any takers?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.