Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

removing server name in PHP mail()

Featured Replies

I know I can use the 5th param in mail() to pass "-f" before the senders email address.

 

But does anyone know how I can also add in the name of the sender, like -

 

me <me@mydomain.com>

 

I can get it to work it using

 

$headers = 'From: me <me@mydomain.co.uk>' . "\r\n" .  
  'X-Mailer: PHP/' . phpversion();

 

but in the email if will show the mail server name like so:

 

Me, me@mydomain.co.uk via sunstorm.3vo.net.

 

 

So far I have tried

 

"-f me <me@mydomain.co.uk>"

 

for the the 5th mail() param, but the result is - me@sunstorm.3vo.net

 

Any help is appreciated

 

Thanks

what is your php code ?

is it like this :

mail($to, $subject, $message, $headers, "-f me@site.com");

 

I believe only some webmail services show it like that(I know gmail does).

@jock even smtp doesn't stop gmail from showing that,you need DKIM signing to hide that .

you can use PHPMailer it has built-in support for that, Or you can also use dkim class php which is a lot like phpmailer

 

https://sourceforge....dkim-class-php/

 

example :

include_once('dkim.class.php');
$dkim = new DKIM();
$dkim_header = $dkim -> get_DKIM_header($to, $subject, $message, $headers);
mail($to, $subject, $message, $dkim_header.$headers);

Edited by Danny87

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.