config mail php

Solutions on MaxInterview for config mail php by the best coders in the world

showing results for - "config mail php"
Alina
19 Mar 2019
1<?php
2$to = "user1@example.com, user2@example.com";
3$subject = "This is a test HTML email";
4
5$message = "
6<html>
7<head>
8<title>This is a test HTML email</title>
9</head>
10<body>
11<p>Test email. Please ignore.</p>
12</body>
13</html>
14";
15
16// It is mandatory to set the content-type when sending HTML email
17$headers = "MIME-Version: 1.0" . "\r\n";
18$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
19
20// More headers. From is required, rest other headers are optional
21$headers .= 'From: <info@example.com>' . "\r\n";
22$headers .= 'Cc: sales@example.com' . "\r\n";
23
24mail($to,$subject,$message,$headers);
25?>