Results 1 to 13 of 13
  1. #1
    thetechmind is offline Upgraded User
    Join Date
    Dec 2006
    Posts
    2,554
    Ok....

    1st time on PHP today , self learning....managed to configure PHP - do the various settings on IIS and also have PHP read and write to a sample DB on MYSQL......



    So at the end of the day , I have managed to read a particular column data and also write to a specific column data....



    Now what I am interested in knowing / learning is : How can I have PHP - "mail" me the contents of the user form.....



    for example....the php page which i created....opens a page with a txt box...on clicking submit it writes the data to mysql db.....



    now what I want to do is have the inputed text 'emailed' to a particular email address...(along with the data going into the DB ).....can it be done ?



    or has it to go only to 1 , i.e either the db or either the mail....



    looking forward for some help here regarding this.....please post examples with codes and how to go abt it if possible.....



    thanks in advance for the assistance.

  2. #2
    Avtar is offline Upgraded User
    Join Date
    Jan 2005
    Posts
    468
    The PHP official website is your friend.



    PHP: Mail - Manual



    Similarly, using the same variables, you can write the data into your database.

  3. #3
    thetechmind is offline Upgraded User
    Join Date
    Dec 2006
    Posts
    2,554
    Quote Originally Posted by Avtar
    The PHP official website is your friend.



    PHP: Mail - Manual



    Similarly, using the same variables, you can write the data into your database.


    thanks for the assistance , will look into the same......



    ...anyone and everyone who would know about this right away , pls do help with the same...

  4. #4
    thetechmind is offline Upgraded User
    Join Date
    Dec 2006
    Posts
    2,554
    Quote Originally Posted by Avtar
    The PHP official website is your friend.



    PHP: Mail - Manual



    Similarly, using the same variables, you can write the data into your database.


    looking throught the thread suggested above....need to figure this out by today afternoon......please assist...

  5. #5
    coolraghav is offline Privileged Users
    Join Date
    Sep 2006
    Posts
    1,034
    mate you can use form mail.



    This should do your job...

    XPertMailer - Advanced PHP Mail Engine

  6. #6
    viridian is offline Upgraded User
    Join Date
    Jun 2008
    Posts
    232
    Stolen from the Mail manual, shamelessly :-p



    <?php

    // The message

    $message = "Line 1\nLine 2\nLine 3";



    // In case any of our lines are larger than 70 characters, we should use wordwrap()

    $message = wordwrap($message, 70);



    // Send

    mail('caffinated@example.com', 'My Subject', $message);

    ?>



    You'll need to configure the email server like described below.

    PHP: Runtime Configuration - Manual

  7. #7
    thetechmind is offline Upgraded User
    Join Date
    Dec 2006
    Posts
    2,554
    Quote Originally Posted by viridian
    Stolen from the Mail manual, shamelessly :-p



    <?php

    // The message

    $message = "Line 1\nLine 2\nLine 3";



    // In case any of our lines are larger than 70 characters, we should use wordwrap()

    $message = wordwrap($message, 70);



    // Send

    mail('caffinated@example.com', 'My Subject', $message);

    ?>



    You'll need to configure the email server like described below.

    PHP: Runtime Configuration - Manual






    As of now im stuck on 2 error messages....


    SMTP server response: 554 5.7.1 <xyz@abc.com>: Recipient address rejected: Access denied
    and




    Fatal error: Class 'Mail' not found


    trying to figure that out...i guess i need to pass the authentication password along with the script as my smtp server needs authentication for outgoing mails......



    @viridian : nothing shamless in what u did , its out there for our reference and usuage thanks.

  8. #8
    thetechmind is offline Upgraded User
    Join Date
    Dec 2006
    Posts
    2,554
    Quote Originally Posted by coolraghav
    mate you can use form mail.



    This should do your job...

    XPertMailer - Advanced PHP Mail Engine




    Checking it out...lets see if it helps.....not checked it yet , but im guessing it might involve some routing via their domain.......just checking....thanks for the reference.

  9. #9
    Arya is offline Privileged Users
    Join Date
    Aug 2006
    Posts
    712
    I think your smtp server is not configured properly. It should allow you to send emails from the address you choose. Which smtp server are you using?



    If you want to use an external SMTP server - How to Send Email from a PHP Script Using SMTP Authentication - About Email using PEAR



    or



    Try Class: SMTP E-mail sending class (smtp, pop3, smtp mail, smtp class) - PHP Classes

  10. #10
    thetechmind is offline Upgraded User
    Join Date
    Dec 2006
    Posts
    2,554
    Now , I have tried 2-3 different scripts and all of them give me the same error....




    Warning: mail() [function.mail]: SMTP server response: 554 5.7.1 <xyz@xyz.com>: Recipient address rejected:


    im using remote smtp autentication itself.....

  11. #11
    nukeu666 is offline Privileged Users
    Join Date
    Dec 2006
    Posts
    2,133
    the address is rejected because the mailserver cannot find anyone with that address

    give a valid email setup on that network
    My Paper/deadtree Book collection: http://pastebin.com/5bkknnFz


  12. #12
    viridian is offline Upgraded User
    Join Date
    Jun 2008
    Posts
    232
    ^^^Agree with nukeu666. Seems like you're asking the mailserver to relay for a domain it's not supposed to.

  13. #13
    thetechmind is offline Upgraded User
    Join Date
    Dec 2006
    Posts
    2,554
    ^^ i guess thats the issue....



    I DO not have a local SMTP server on my PC and I am trying to send external emails to .gmail.com and .yahoo.com domains........and thats why I'm guessing im getting the error messages.



    Correct me if I'm wrong , I would need to have the needfull files placed on a configured SMTP server.......

 

 

Similar Threads

  1. Suggest Free Email Hosting Service with Email Archive?
    By TECH HUNTER in forum Networking
    Replies: 0
    Last Post: 21-11-10, 03:21 PM
  2. Sending email using CDO on ssl port 465
    By madhuraj in forum Programming
    Replies: 1
    Last Post: 27-09-10, 12:59 PM
  3. Replies: 3
    Last Post: 16-06-10, 11:36 AM
  4. Need PHP HELP TO INSTALL PHP.
    By yohanns23 in forum Programming
    Replies: 8
    Last Post: 01-11-09, 09:39 PM
  5. PHP and PHP nuke
    By techboy in forum Programming
    Replies: 4
    Last Post: 28-03-06, 07:50 PM

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
  •  
All times are GMT +5.5. The time now is 06:16 AM. Powered by vBulletin® Version 4.1.12
Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.
Content Relevant URLs by vBSEO 3.6.0 PL2