SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member JohnAadams's Avatar
    Join Date
    Oct 2011
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help in contact .xml

    i had a website in xml and i have designed the contact for can you guys tell me how to send mails through it. Most of the guys has told me about php one but did not given any source code . Please if any one has share it

  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2011
    Posts
    67
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    what does your xml form look like?

    you will atleast need a contact.php page or something like that and add the following code (depending on whats in your form)
    PHP Code:
    <?php

    if(isset($_POST['email'])){
        
    $to $_POST['email'];
        
    $from =  'your@email.com';
        
    $subject $_POST['subject'];
        
    $message $_POST['message'];
        
    mail($to$subject$message'From: ' $from);
    }
    more on PHP mail can be found here: http://php.net/manual/en/function.mail.php

  3. #3
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:


    You'll find detecting a POST request is much more robust with...
    Code:
    <?php
    if('POST' === $_SERVER['REQUEST_METHOD']){
        
    }
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •