Joomla! version : 3.8
PHP version : 7
AdsManager version : 3.1.11
Hello!
How can I send the user a custom email from backend. Can I make a "custom code field" for this?
So that when I press a button in backend inside a ad, a mail gets send to the user.
I tryed to make a field like this, and put this code in "Edit view custom code". But I think its the wrong way to do it.
<input type="submit" name="button" value="Send mail" class="button"
<?php
if (isset($_POST['button'])) {
$to = "user345@mail.com";
$From = "support@mysite.com";
$SMTPServer = "...";
$SMTPPort = ...;
$mail->SMTPSecure = "ssl";
$Username = "...";
$Password = "...";
$mail->SMTPAuth = ...;
$subject = utf8_decode('test');
$message = utf8_decode('hello user 345');
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= '...' . "\r\n" .
'Reply-To: ...' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
}
PHP version : 7
AdsManager version : 3.1.11
Hello!
How can I send the user a custom email from backend. Can I make a "custom code field" for this?
So that when I press a button in backend inside a ad, a mail gets send to the user.
I tryed to make a field like this, and put this code in "Edit view custom code". But I think its the wrong way to do it.
<input type="submit" name="button" value="Send mail" class="button"
<?php
if (isset($_POST['button'])) {
$to = "user345@mail.com";
$From = "support@mysite.com";
$SMTPServer = "...";
$SMTPPort = ...;
$mail->SMTPSecure = "ssl";
$Username = "...";
$Password = "...";
$mail->SMTPAuth = ...;
$subject = utf8_decode('test');
$message = utf8_decode('hello user 345');
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= '...' . "\r\n" .
'Reply-To: ...' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
}
Custom Fields
- Joomla Version
- 3.8
- PHP Version
- 7.0
- Product
- AdsManager
- Product Version
- 3.1.11