#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2014
    Posts
    139
    Rep Power
    4

    How can I change username "ROOT" when send mail


    Hello, How can I change my username "ROOT" when I send mail in C.

    system ("mail -s test example@gmail.com < mytext.txt");

    It works, but when I read my mail, the username is ROOT, anyone know how can I change?
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2015
    Posts
    1
    Rep Power
    0
    It looks like your webserver is running as root user , that is why it sending email as ROOT . You don't run your website as root user. Make a local user and use that for your scripts. Otherwise use "smtp" authentications.
  4. #3
  5. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,553
    Rep Power
    4549
    Add a from header to the message. man mail will explain how
    ======
    Doug G
    ======
    I've never been able to appreciate the sublime arrogance of folks who feel they were put on earth just to save other folks from themselves .." - Donald Hamilton

IMN logo majestic logo threadwatch logo seochat tools logo