0

How would I be able to use a random number php function in my subject using PHPMailer?

$mail->Subject = '*- Mailer Tester -*';

and I would like to add the following code into it,

rand();

note: I've already tried the easy solution of just adding it following the "*" but it just adds the text so in the email subject it would be like

*- Mailer Tester -* rand();
Keelan
  • 11
  • 3
  • maybe this is what you are looking for don't know where you want the rand() tho `$mail->Subject = '*- Mailer Tester -*'.rand();` – Collin ter Steege Sep 14 '18 at 06:59
  • 1
    Possible duplicate of [How to combine two strings together in PHP?](https://stackoverflow.com/questions/8336858/how-to-combine-two-strings-together-in-php) – mhutter Sep 14 '18 at 06:59
  • kind of makes your email look like spam to be honest –  Sep 14 '18 at 07:03

1 Answers1

0

try

$mail->Subject = '*- Mailer Tester -*'.rand();
Rp9
  • 1,955
  • 2
  • 23
  • 31