Jump to content

Gainax

Members
  • Posts

    30
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Gainax's Achievements

Member

Member (2/5)

0

Reputation

  1. Ok I now have this: $to = 'me@example.com'; $subject = "Form Submit"; $headers .= "From: Website <me@example.com>\r\n"; $headers .= "To: me2@example.com\r\n"; $headers .= "Cc: clients1@example.co.uk\r\n"; $headers .= "Bcc: client2@example.com\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; if (mail($to, $subject, $message, $headers)) { header('Location: thankyou.php'); } else { echo("<p>Message delivery failed...</p>"); } Does this look ok?
  2. Ok I have the following code now, and only I can get the emails: $to = 'client1@example.co.uk,client2@example.co.uk,me@example.com'; $subject = "Form Submit"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "To: Client1 <client1@example.co.uk>,Client2 <client2@example.co.uk>,Me <me@example.com>\r\n"; $headers .= "From: Website <website@example.co.uk>\r\n"; $to = explode(',',$to); foreach($to as $recipient) { if (mail($recipient, $subject, $message, $headers)) { header('Location: thankyou.php'); } else { echo("<p>Message delivery failed...</p>"); } } I get the emails fine. But the other 2 email addresses don not receive anything. Is there anything wrong with my code? Thanks
  3. Ok thanks. I'll see If those who should get the emails do in fact get them Thanks
  4. My code is : $to = 'jim@example.com, bob@example.com, ted@example.com'; $subject = "New Applicants submit"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "To: Ted <ted@example.com>, bob <bob@example.com>, jim <jim@example.com>\r\n"; $headers .= "From: Website <website@example.com>\r\n"; $to = explode(',',$to); foreach($to as $recipient) { mail($recipient,$subject,$msg,$headers); } Should this work?
  5. What about the headers? The email gets sent as HTML. Can I still have the $headers in the mail()?
  6. Will I still have the following code? $to = "bob@example.com, ted@example.com, jim@example.com";
  7. So something along the lines of: $to = "bob@example.com"; $subject = "New Applicants submit"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; /* headers adicionais */ $headers .= "From: Web <website@example.com>\r\n"; $headers . = "Cc: jim <jim@example.com>, ted <ted@example.com>"; mail($to, $subject, $msg, $headers);
  8. $to = "bob@example.com, ted@example.com, jim@example.com"; Will this do?
  9. Hi I have a form which sends out an email. I'm trying to send it to muliple people. The following is my code: $to = "bob@example.com"; $subject = "New Applicants submit"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; /* headers adicionais */ $headers .= "To: Jim <jim@example.com>, Ted <ted@example.com>\r\n"; $headers .= "From: Web <website@example.com>\r\n"; mail($to, $subject, $msg, $headers); This all works fine when I put the email addresses of some of my colleagues (using Gmail). But If I try putting any other email, those who use Outlook, no-one receives the emails. Is there anything wrong with my form?
  10. I had the following code: $body = "Name: " . $name . "\n\n" . "Address: " .trim($address); and then tried: $body = "Name: " . $name . "\n\n" . "Address: " .nl2br($address);
  11. function validateAddress($address){ //if it's NOT valid if(strlen($address) < 4) return false; //if it's valid else return true; }
  12. I tried that too, and it didn't work
  13. I have a form, which takes the input and when submitted it sends an email to me with the content. One field is a textarea and when I get the email I get \r\n where someone has gone onto a newline in the text area. My form is: <form id="requestform" name="requestform" method="post" action=""> <p><label for="name">Name:*</label><br /> <?php echo (($nameOK) ? "" : "<p style=\"color:red;\"><strong>Invalid Name: </strong> Your name must be at least 3 letters<br /></p>"); ?> <input name="name" class="text" type="text" id="name" value="<?=$_POST['name'] ?>" /></p> <p><label for="address">Address:*</label><br /> <?php echo (($addressOK) ? "" : "<p style=\"color:red;\"><strong>Invalid Address: </strong> Please enter your full address<br /></p>"); ?> <textarea name="address" class="text" name="address" cols="30" rows="5" value="<?=$_POST['address'] ?>" ></textarea><br /></p> <button type="submit" name="send" value="send" style="height: 26px; width: 96px; border: 0px;" ><img src="images/send_request.jpg" alt="send" title="" /></button> And the code which takes the form data is: <?php if( isset($_POST['send'])) { $nameOK = validateName($_POST['name']); $addressOK = validateAddress($_POST['address']); if ($nameOK && $addressOK ) { $to = "example@example.com"; $subject = "Request"; $body = "Name: " . $name . "\n\n" . "Address: " .$address; $headers = 'From: example@example.co.uk' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); if (mail($to, $subject, $body, $headers)) { header('Location: thankyou.php'); } else { I've tried using nl2br around the $address variable, but I still get the \r\n after each linebreak Am I doing anything wrong? Thanks
  14. I have 3 classes in mycode, which uses a background image in the CSS. (3 classes, 3 diff images) I want the image to act as a link. My code is as follows: <h2 class="dashboard-facilities-header">Facilities</h2> <div> <p class="dashboard-desc">Here you can add/edit your profile that everyone can see!</p> </div> </div> <div class="user-dashboard-boxes"> <h2 class="dashboard-teams-header">Teams & Clubs</h2> <div> <p class="dashboard-desc">Here you can add/edit your profile that everyone can see!</p> </div> </div> <div class="user-dashboard-boxes"> <h2 class="dashboard-events-header">Events</h2> <div> <p class="dashboard-desc">Here you can add/edit your profile that everyone can see!</p> </div> </div> h2.dashboard-facilities-header {background-image:url(../images/dashboard-facilities-header.png);background-repeat:no-repeat;height:25px;text-indent:-9999px;} h2.dashboard-teams-header {background-image:url(../images/dashboard-teams-header.png);background-repeat:no-repeat;height:25px;text-indent:-9999px;} h2.dashboard-events-header {background-image:url(../images/dashboard-events-header.png);background-repeat:no-repeat;height:25px;text-indent:-9999px;} All help is welcome
×
×
  • 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.