Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    May 2014
    Posts
    24
    Member #
    39302

    phpmailer contact form

    Hi,
    I created a phpmailer contact form, it doesn't work,
    indicated on 25: line Warning: Creating default object from empty value in /htdocs/index.php
    ($mial->Password = "abcde"; )

    on line 27: Fatal error: Call to undefined method PHPMailer::SetFrom() in /htdocs/index.php
    $mail->SetFrom($_POST['emailid'], $_POST['fullname']);

    my SMTP server is: mail.kiva-trial.fr
    can someone help me ?
    thanks!

    it is the script:

    <?php
    if(isset($_POST['submit']))
    {

    $message=
    'Full Name: '.$_POST['fullname']. '<br/>
    Subject: '.$_POST['subject']. '<br/>
    Phone: '.$_POST['phone']. '<br/>
    Email: '.$_POST['emailid']. '<br/>
    Comments: '.$_POST['comments'].'
    ';
    require "phpmailer/class.phpmailer.php";

    $mail = new PHPMailer();

    $mail->IsSMTP();
    $mail->SMTPAuth = true;
    $mail->SMTPSecure = "ssl";
    $mail->Host = "mail.kiva-trial.fr";
    $mail->Port = 465;
    $mail->Encoding = '7bits';

    $mail->Username = "mail.kiva-trial.fr";
    $mial->Password = "abcd";

    $mail->SetFrom($_POST['emailid'], $_POST['fullname']);
    $mail->AddreplyTo($_POST['emailid'], $_POST['fullname']);
    $mail->Subject = "New contact form";
    $mail->MsgHTML($message);

    $mail->AddAddress("abcd@yahoo.fr", "Kiva");
    $result = $mail->Send();
    $message = $result ? 'sucessfully send!' : 'Send fail';
    unset($mail);

    }
    ?>
    <html>

    <body>
    <form name="form1" id="form1" action="" method="post">
    <fieldset>
    <input type="text" name="fullname" placeholder="Full Name" /> <br/>
    <input type="text" name="subject" placeholder="Subject" /> <br/>
    <input type="text" name="phone" placeholder="Phone" /> <br/>
    <input type="text" name="emailid" placeholder="Email" /> <br/>
    <textarea rows="4" cols="20" name="comments" placeholder="Comments"></textarea><br/>
    <input type="submit" name="submit" value="Send" />
    </fieldset>

    </form>

    </body>

    </html>

  2.  

  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,686
    Member #
    5580
    Liked
    716 times
    mail?

    $mial->Password = "abcd";


  4. #3
    Member
    Join Date
    Mar 2015
    Posts
    52
    Member #
    47779
    Liked
    3 times
    Are you trying it in local server or demo server?


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:05 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com