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

    Join Date
    Apr 2000
    Posts
    31
    Rep Power
    15
    I have a script which is using the mail function, mail($mailTo, $mailsujet, $mailbody, $mailhead);
    The script work fine but when I received the message, the address is from: www@host.hosting-canada.net
    the address of my provider and not my domain. I want webmaster@mydomain.com in the header..

    Any suggestions on how to fix this?
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    5
    Rep Power
    0
    The mail function will automatically using the web-access-name on ur server, if u want do more tricks, try use the mime_mail class.

    It's easy to find a open source class.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    6
    Rep Power
    0
    I had a similar problem. Let your header equeal the following. This worked for me.
    Let the $from be the email address you want to show up when they open their mail. Let me know if it works.


    $mailhead = "From:t $from";

  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    43
    Rep Power
    15
    I learned a few tricks with the mail function.
    That's correct to use the $mailhead as previously described. In addition theres another method that allow a string to be attached to an e-mail address similar to a label. Use the following for this:
    $from = "webmaster@domain.com";
    $mailhead = "From: CompanyName <$from>";
    This will show CompanyName in the recieved mail under FROM but reply's will be sent to the e-mail address within the <$from> tag. This is a nice way to personalize e-mail. Some consider the e-mail address itself under the FROM as kind of ugly but it's your choice.

Similar Threads

  1. How do I set up mail?
    By ITmax in forum Mail Server Help
    Replies: 4
    Last Post: June 1st, 2005, 10:56 AM
  2. Help with script
    By akastarlight in forum Perl Programming
    Replies: 1
    Last Post: February 6th, 2004, 07:55 AM
  3. mail function smtp problem
    By emzyme in forum PHP Development
    Replies: 3
    Last Post: January 25th, 2004, 07:59 PM
  4. Java mail problem.
    By Programmer123 in forum Java Help
    Replies: 4
    Last Post: January 24th, 2004, 12:21 PM
  5. php mail permissions problem
    By LANLord in forum PHP Development
    Replies: 3
    Last Post: January 20th, 2004, 09:26 AM

IMN logo majestic logo threadwatch logo seochat tools logo