Re: How to cath mail error

K <[email protected]> Sat, 11 Mar 2023 07:54:33 -0800 (PST)
Newsgroups alt.comp.lang.php
Message-ID <[email protected]>
Get to watch Jesus videos !

youtu.be/-3nN9-C1yKU

...
..............
.....................................................................
...........................................................................=
...............................



On Monday, May 30, 2022 at 3:08:33=E2=80=AFPM UTC+2, Jakub wrote:
> I have this code to sand email:=20
>=20
>=20
> function sendEmail($to, $title, &$text) {=20
> $from =3D '[email protected]';=20
> $subject =3D $title;=20
>=20
> $w =3D '<html><head><meta http-equiv=3D"content-type"=20
> content=3D"text/xhtml; charset=3Dutf-8"></head>=20
> <body=20
> style=3D"background-color:#ffffff;color:#000000;margin-top:30px;margin-le=
ft:30px;padding:10px;"><hr><br>'=20
> . $text . '<hr><br><p><a href=3D"mailto:'=20
> . $from . '">' . $from . '</a></p></body></html>';=20
>=20
> $he =3D 'MIME-Version: 1.0' . PHP_EOL . 'Content-type: text/html;=20
> charset=3Dutf-8 ' . PHP_EOL=20
> . 'From: admin Search. <' . $from . '>' . PHP_EOL=20
> . 'Content-Transfer-Encoding: base64' . PHP_EOL;=20
>=20
> $w =3D chunk_split(base64_encode($w));=20
> imap_mail($to, $subject, $w, $he);=20
> }=20
>=20
>=20
> how to catch this error=20
>=20
> Warning: imap_mail(): Failed to connect to mailserver at "localhost"=20
> port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use=20
> ini_set()=20
>=20
> thank for answers=20
>=20
> Jakub