Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8624331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:30:12+00:00 2026-06-12T07:30:12+00:00

In php Mail Function, when we send headers, can we set the From Mail

  • 0

In php Mail Function, when we send headers, can we set the “From Mail” to be a Word like “Company Newsletter” Only, not in an email form as newsletter@company.com ??
how can we do that ? because writing it is (not in an email form) prevents the email from being sent.

here’s my code:

  $headers  = "MIME-Version: 1.0\r\n";
  $headers .= "Content-type: text/html; charset=windows-1256\r\n";

i have tried what tim suggested , having

  $row['SenderMail'] =  "Company Newsletter <Newsletter@ids.com.lb>";
  $headers .= "From:".$row['SenderMail']."\r\n"; 

  $subject=str_replace('%26','&',$row['Subject']);

  @mail($row['DestinationMail'], $subject, $row['Body'],$headers);

But still email isn’t being sent.any help ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T07:30:14+00:00Added an answer on June 12, 2026 at 7:30 am

    Please use the following :

    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=windows-1256'."\r\n";
    $headers .= 'To: '.$row['SenderMail'].' <'.$row['SenderMail'].'>'."\r\n";
    $headers .= 'From: Company Newsletter <Newsletter@ids.com.lb>'."\r\n";
    
    mail($row['DestinationMail'], $subject, $row['Body'], $headers);
    

    That should do the trick !

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the PHP mail() function to send email from a contact form. The
I am using php's mail() function to send an email from a php scrpit,
so I'm trying to use PHP's mail() function to send an email when users
I'm facing an error with PHP's mail() function. The mail() function can successfully send
I've got a project where by I send email using PHP's inbuilt mail() function,
I use PHP mail() function to send emails from my website. No problems with
For some reason my php mail() function does not send html, Instead of <a
I can't seem to send any mail using PHP's mail() function whenever I specify
I want to send an e-mail using the mail-function in PHP. The FROM-part of
I'm trying to send mail via the PHP mail() function which as far as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.