The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Sending a text based email in PHP
tudsy
post Dec 3 2020, 03:40 AM
Post #1


Advanced Member
****

Group: Members
Posts: 246
Joined: 30-September 14
Member No.: 21,611



Hi

I am having trouble sending email in PHP. I am testing to see whether I can send a confirmation email to the user.

Here is sample code on how to send email in PHP:




$to ="";
$subject = "";
$message="";
$headers=" ";

/* recipients */
$to = $email;





/* subject */
$subject = "Confirm your email to join the Ecovib2d family";

/* message */
$message = "Ecovib2d Confirmation:

You are receiving this email because you filled out a registration form on this website.

If you did not subscribe, you can simply delete this email. No further action is required.

To complete confirmation and add your subscription, please click on the following link:


https://ecovib2d.com.au/workfromhome/subscr...&t=$to

Thank you and hope you enjoy using Ecovib2d!
";

// To send HTML mail - you can set the Content-type header

$headers = "MIME-Version: 1.0\r\n";
$headers = $headers." Content-type: text/html charset=iso-8859-1\r\n";

// additional headers
$headers = $headers."From: ADRIAN at ECOVIB2D <ecovib2d@live.com>\r\n";


// and now mail it
mail($to, $subject, $message, $headers);


Any help will be helpful.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
Christian J
post Dec 4 2020, 08:46 AM
Post #2


.
********

Group: WDG Moderators
Posts: 9,665
Joined: 10-August 06
Member No.: 7



Also the $email variable is never given a value.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th May 2024 - 09:03 AM