Jump to content

Search the Community

Showing results for tags 'mail()'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Found 6 results

  1. I recently decided to have the data from the forms that were filled out not only emailed to me but to the person filling the form out for conf. When the form is finished and the person hits submit every comes up with the success and the data gets logged on the server but the emails never send out. Any help is much appreciated. Here is the code: <?php $name = $_POST["First"]; $Last_name = $_POST["Last"]; $Age = $_POST["Age"]; $Height = $_POST["Height"]; $Weight = $_POST["Weight"]; $Eye_Color = $_POST["Eye"]; $Hair = $_POST["Hair"]; $Glasses_or_Contacts = $_POST["Glasses_or_Contacts"]; $Customer_Email = $_POST["Contact_Email"]; $email_from ='WEBMASTEREMAIL@gmail.com'; $email_subject = "Form completion Email"; $email_body = $name . $Last_name . $Age . $Height . $Weight $Eye_Color . $Hair . $Glasses_or_Contacts . $Customer_Email; $to = 'CUSTOMEREMAIL@gmail.com, WEBMASTEREMAIL@gmail.com'; $headers = "From: $email_from rn"; if(!mail($to,$email_subject,$email_body)) { echo 'failed'; } else { echo 'sent'; } ?> All emails were replaced in caps. btw And yes I have checked spam and still nothing is sent.
  2. Hello! I am trying to make a contact form and hoping for some help because I cannot make the thing work! The data entered by the user should be sent to my hotmail account eg me@hotmail.com. I have created this html form: <form method="post" name="contact_form" action="doContact.php"><input type="text" name="name" placeholder="Name" size="50" autocomplete="off" autofocus><br /><input type="text" name="mail" placeholder="e-mail" size="50" autocomplete="off" required><br /><input type="text" name="subject" placeholder="Subject" size="50" autocomplete="off"><br /><textarea name="message" placeholder="Message" maxlength="1000" cols="43" rows="6" autocomplete="off" required></textarea><br /><input type="submit" value="SEND"></form> The doContact.php file contains the following code: <?php ini_set('display_errors', 1); error_reporting(E_ALL);$name=$_POST['name'];$mail=$_POST['mail'];$subject=$_POST['subject'];$message=$_POST['message'];$message = str_replace("n.", "n..", $message);$message = wordwrap($message, 70, "rn");$to="me@hotmail.com";$body="From ".$name." with e-mail: ".$mail." message: ".$message;if (mail ($to, $subject, $body)==TRUE) { echo "<p>Your message has been sent!</p>"; }else{ echo "<p>Something went wrong, please try again!</p>"; }?> I am working in Windows8 x64 with WampServer v2.5, so at the beginning I was getting a: mail():Failed to connect to mailserver at "localhost" port 25 error and my <p>Something went wrong, please try again!</p> was "echoing". I did a lot of search and I discovered that this was because I didn't have any mail server installed. Instead of installing a mail server, and after I unsuccessfully tried to edit the php.ini with hotmail's smtp, port and my account credential (it didn't make any difference, I was still getting the mail():Failed to connect to mailserver at "smtp.live.com" port 465) I chose to first try the solution pointed here. So I downloaded the sendmail app and changed my php.ini and sendmail.ini accordingly (meaning with the smtp and pop3 data of hotmail and my account credentials, as instructed). I restarted wamp and tested again: now it does not return any error but the mail returns false, so I get the "<p>Something went wrong, please try again!</p>" message and the mail is not sent. Do you know how to fix this? Also, if I cannot make this work and I try to install a mail server locally to test my code, does that mean that after uploading my site in an actual hosting server online (not localhost) the local mail server will NOT be required anymore? I know this is a noob question but I am very new to this... Any help will be very much appreciated! Thank you all!
  3. This is too simple but I can't find the answer. I want to send multiple error messages in separate paragraphs in an email sent with mail(). I want to avoid using html. Here's what I tried as a test to see how to make separate paragraphs: mail('email@address', 'System Error','The error(s) relate to a purchase.nnPlease review the PayPal emails and IPN history to determine the correct status of the artwork./n/nMake whatever corrections to the database are needed.', 'FROM: email@address' ); and here's what I get: The error(s) relate to a purchase.nn Please review the PayPal emails and IPN history to determine the correct status of the artwork.nn Make whatever corrections to the database are needed. I'm not even getting a new line, let alone two so it seems inconsistent with the guidance in the Manual. I also tried rr and rn with no luck. Can I do what I am trying to do?
  4. Hi there!! I have copied and changed the following code snippet from the php.net site: <?php$to = 'myusername@mydomain.com';$subject = 'the subject';$message = 'hello';$headers = 'From: webmaster@example.com\r\n';if(mail($to, $subject, $message, $headers)){ echo "Success!!"; }?> unfortunately, my script wasn't executed and I didn't receive the email even in my junk folder. Can someone help me solve this trouble? Thanks in advance!! atar.
  5. Mudsaf

    mail() questions

    Im wondering how does this mail() function work. I got PHP script likewhile ($row = mysql_fetch_array($result2)) {mail($row['Sahkoposti'], 'New comment on websites', '$text');} 1. $row['Sahkoposti'] = Email2. 'Subject'3. text Im wondering does this email thing require SMTP service or some port open to work correctly.
  6. <?php$name = $_POST['name'];$email = $_POST['email'];$website = $_POST['website'];$message = $_POST['message'];$subject = "testing PHP 121";$headers = "Sender: ".$name." His\/Her website: ".$website;mail($email,$subject,stripslashes($message),$headers);?> <form id="contacts-form" method="post" action="mail_sent.php" target="_blank"> <fieldset> <div class="field"><label>Your Name:</label><input type="text" name="name" value=""/></div> <div class="field"><label>Your E-mail:</label><input type="text" name="email" value=""/></div> <div class="field"><label>Your Website:</label><input type="text" name="website" value=""/></div> <div class="field"><label>Your Message:</label><textarea cols="1" name="message" rows="1"></textarea></div> </fieldset> <input type="button" value="Submit" onclick="submitForm('contacts-form')" /> </form> <script> function submitForm(){ document.getElementById("contacts-form").submit(); } </script> I've tried many PHP String methods like stripslashes() but seem to fail to escape the slashes in $headers = "Sender: ".$name." His\/Her website: ".$website; I used "\" to escape the "/" but failed.
  • Create New...