this is my php.ini file:
[mail function]
; For Win32 only.
; [php.net]
SMTP = localhost
; [php.net]
smtp_port = 25
; For Win32 only.
; [php.net]
sendmail_from ="admin@wampserver.invalid"
; For Unix only. You may supply arguments as well (default: "sendmail -t -i"
.
; [php.net]
;sendmail_path =
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail().
;mail.force_extra_parameters =
; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = On
; The path to a log file that will log all mail() calls. Log entries include
; the full path of the script, line number, To address and headers.
;mail.log =
; Log mail to syslog (Event Log on Windows).
;mail.log = syslog
yo is my mail.php file
require_once 'PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->isSMTP();
$mail->Host = 'I do not know what to write';
$mail->Port = 25;
$mail->SMTPAuth = true;
$mail->Username = '????? I do not know what to write';
$mail->Password = '????? I do not know what to write';
$mail->SMTPSecure = 'tls';
$mail->setFrom('admin@test.com', 'TEST');
$mail->sendBy = 'TEST';
$mail->addAddress('test@gmail.com', 'TEST');
$mail->addReplyTo('test@gmail', 'TEST');
$mail->Subject = 'TEST';
$mail->Body = 'TEST<br>TEST MAIL';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
}
else
{
$_SESSION['udana_rejestracja']='EMAIL SEND';
header
(
'Location: contact'
)
;
}
previously I had configured with an external smtp server
for example, gmail.
but I would like to configure settings with the local server
does anyone know how to do it?
what to enter in the fields Host ,Username ,Password ????
what you need to change in apache files, etc.???
Edited 2 time(s). Last edit at 04/26/2018 06:23PM by RiggsFolly.