Jump to content

Search the Community

Showing results for tags 'mail'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (Dreamweaver, Zend, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 3 results

  1. , 02:03 PM //My contact.php <!DOCTYPE html> <html> <body> <div class="col-sm-6"> <form onsubmit="return false"> <div class="form-group"> <label for="cname" class="control-label">Full Name:</label> <input type="text" class="form-control" name="cname" id="cname"> </div> <div class="form-group"> <label for="mob" class="control-label">Phone Number:</label> <input type="text" class="form-control" name="mob" id="mob"> </div> <div class="form-group"> <label for="mail" class="control-label">Email Address:</label> <input type="email" class="form-control" name="mail" id="mail"> </div> <div class="form-group"> <label for="msg" class="control-label">Message:</label> <textarea class="form-control" rows="4" name="msg" id="msg" style="resize:none"></textarea> </div> <div id="sendmsg"> </div> <button type="submit" name="sendemail" id="sendemail" class="btn btn-success">Send Message</button> </form> </div> <script src="../res/js/jquery.min.js"></script> <script src="../res/js/bootstrap.min.js"></script> <script> $(function(){ $("#sendemail").click(function(){ var err = reqfield_val(['cname', 'mob', 'mail', 'msg']); if(err == 0){ $.ajax({ type: 'post', data: $('form').serialize() }); <?php require_once('../res/php/code.php'); $res = sendemailfn(); // I want to use the function return value here ?> $("#sendmsg").text('<?=$res?>').css("opacity",'1'); } }); }); </script> </body> </html> //mail function code in code.php file <?php function sendemailfn() { if($_POST) // to prevent form submission on page reload (& on not using this condition function is returning the value) { $res = ""; $cname = $_POST['cname']; $email_from = $_POST['mail']; $mobile = $_POST['mob']; $msg = $_POST['msg']; $to = 'muzaffar527@gmail.com'; $body = 'Name'.$cname. '\nEmail'.$email_from. '\nMobile'.$mobile. '\nMessage'.$msg; $subject = 'Enquiry from www.zuhaconsultants.com'; $headers = 'From: '.$email_from."\r\n" . 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); $mail_sent = mail($to, $subject, $body, $headers); if($mail_sent == true) $res = "Thank you for contacting us. We will be in touch with you very soon."; else $res = "Seems Some Error Occured."; return $res; // this value is not returned to contact.php page // if the about condition if($_POST) is not given then it is returning the value // if it is not given the page is submitting the form on page reload } } ?> Please help me get the return value $res... in the same way please note that the form should not be submitted on page reload Thanking you
  2. I finally got a godaddy client to pipe my mail into a local folder. The file names look like 1516137911.M489417P234988.p3plcpnl0896.prod.phx3.secureserver.net,S\=953331,W\=963315 (the file name(?) seem quite irregular - I don't recognize it) I can cat it and I'm convinced everything is there. I know I have to open these with some php class/function that understands the structure, so that I can pluck out what I want. But I don't have a clue how to even begin this. This is one of the 'get of the dime' post. A single example, a short one, would be much appreciated. Thank you. godaddy, php7
  3. I'm having a probably server-side issue that I cannot fix, so I need to find a workaround. I have a page designed to allow people to enter their report and email it to a list of people (it will vary each time). There are 2 ways people can enter an email recipient: full email address or first and last name (which is how you find people in the corporate Outlook Exchange accounts). So when the recipient field is entered, it may contain a mix of full email addresses or just first and last names (separated by commas). For example, here's my original array of email recipients: $recipient = "bob.smith@abc.com, John Smith, Barb Johnson"; The problem is with the first and last names. When the email sends, it adds the entire domain of the server to the email address. For example, if the server I'm using is "test.server.xyz.com" and I enter "John Smith", when the email gets sent, it sends to "John.Smith@test.server.xyz.com" instead of just "John.Smith@xyz.com". So I'm wondering if there's code that would search an array using mixed email addresses, locate just the ones with first and last names, and fix them. How would I code this so it ended up as: $new_recipients = "bob.smith@abc.com, John.Smith@xyz.com, Barb.Johnson@xyz.com"; Thanks in advance! Note: I've asked IT if they can fix something on the server end to correct this, but I'm not counting on their help, so looking for a workaround.
×
×
  • 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.