Results 1 to 5 of 5

Thread: mail() help please

  1. #1
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default mail() help please

    Hi guys long time no speak!
    I am having troubles with this line of code:
    PHP Code:
    mail("$Email""Thank you for your Enquiry""Dear "$FirstName"""we have recieved your enquiry and one of our professional FSA Regulated advisors will be in contact very soon! Thank you""From: Enquiries.We-Remortgage"); 
    Could someone tell me what I am doing wrong? no experience with PHP :/

    Thank you

  2. #2
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Don't put $email between " ", I will look into it. one min

    PHP Code:
    Mail("myEmail@hotmail.com""my subject""the message",""); 
    or with vars

    PHP Code:
    $mailadr      'myEmail@hotmail.com';
    $subject 'my subject';
    $msg'the message';

    mail($mailadr$subject$msg""); 
    or with a header with vars

    PHP Code:
    $mailadr 'myEmail@hotmail.com';
    $subject 'my subject';
    $msg 'the message';
    $header 'From: BillGates@microsoft.com';

    mail($mailadr$subject$msg$header); 
    Last edited by masterBB; 10-03-2012 at 07:38 PM. Reason: forgot semicolon
    Working on: Tithe Farmer

  3. #3
    Join Date
    Apr 2008
    Posts
    89
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Also make sure you concatenate strings properly with a period. Take a look at http://php.net/manual/en/language.operators.string.php if you need help.

  4. #4
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,035
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    I'm pretty sure you need a smtp server running. At least for that method.

    Actually, It seems you can specify a smtp server in php.ini, but it defaults to a localhost server.

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

  5. #5
    Join Date
    May 2007
    Location
    UK
    Posts
    4,007
    Mentioned
    1 Post(s)
    Quoted
    12 Post(s)

    Default

    Hi guys, cheers for the replies, basically I am retrieving info from a form in this instance $Email.
    I need to send to that email.
    And in the body of the message say:
    "Dear $FirstName blah blah blah"

    Cheers

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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