PHP အီးမေးပို့
- အရှေ့စာလုံး PHP Sessions
- နောက်ပိုင်း စာလုံး PHP မှတ်ချက် E-mail
PHP က စက်ပိုင်းမှ သတင်းစား သတင်းပို့လိုက်ရန် ခွင့်ပြုသည်。
PHP mail() သတင်းပို့ လုပ်ငန်း
PHP mail() သတင်းပို့ လုပ်ငန်း က စက်ပိုင်းမှ သတင်းစား သတင်းပို့လိုက်သည်。
သတင်းပို့
mail(to,subject,message,headers,parameters)
ပါးချိန် | ဆက်ကြည့် |
---|---|
to | Required. Specify the email recipient. |
subject | Required. Specify the subject of the email. Note: This parameter cannot contain any newline characters. |
message | Required. Define the message to be sent. Use LF (\n) to separate each line. |
headers | Optional. Specify additional headers, such as From, Cc, and Bcc. Should use CRLF (\r\n) to separate additional headers. |
parameters | Optional. Specify additional parameters for the mail sending program. |
Note:PHP requires a mail system that is installed and running to make the mail functions available. The program used is defined by configuration settings in the php.ini file. Please refer to our PHP Mail လက်တွေRead more.
PHP Simple Email
The simplest way to send an email using PHP is to send a text email.
In the following example, we first declare variables ($to, $subject, $message, $from, $headers), and then we use these variables in the mail() function to send an e-mail:
<?php $to = "someone@example.com"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = "someonelse@example.com"; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent."; ?>
PHP Mail Form
Using PHP, you can create a feedback form on your own site. The following example sends a text message to a specified e-mail address:
<html> <body> <?php if (isset($_REQUEST['email'])) //if "email" is filled out, send email { //send email $email = $_REQUEST['email'] ; $subject = $_REQUEST['subject'] ; $message = $_REQUEST['message'] ; mail( "someone@example.com", "Subject: $subject", $message, "From: $email" ); echo "Thank you for using our mail form"; } else //if "email" is not filled out, display the form { echo "<form method='post' action='mailform.php'> Email: <input name='email' type='text' /><br /> Subject: <input name='subject' type='text' /><br /> Message:<br /> <textarea name='message' rows='15' cols='40'> </textarea><br /> <input type='submit' /> </form>"; } ?> </body> </html>
အမှတ်အသောက် အရာ
- အပြီးအပိုင်းတွင် အမြန်အောင် လိုက်နာရာ ကို ဆိုင်းသုံးရာ အမြန်အောင် မျှော်လင့်ရာ
- ဝင်းငြိမ်းဆုံး တာဝန်ပေးချက် ချက်ပေးတာ မရှိ (အခု စာလုံးပြု ပြီး ပြန်လည် ကြည့်ရှုခြင်း မပြုရသည် အခါ ပါ) ထဲက အချက်အလက် ကို အသုံးပြု၍ အချက်အလက် ပြုလုပ်ထား ပြီး အချက်အလက် ပေးခြင်း
- ဝင်းငြိမ်းဆုံး တာဝန်ပေးချက် ချက်ပေးတာ မရှိ (အခု စာလုံးပြု ပြီး ပြန်လည် ကြည့်ရှုခြင်း မပြုရသည် အခါ ပါ) ထဲက အချက်အလက် ကို အသုံးပြု၍ စာလုံး ပေးပို့ခြင်း
- ဝင်းငြိမ်းဆုံး တာဝန်ပေးချက် ချက်ပေးတာ တွင် စာလုံးပြု ပြီး လုပ်ကြမ်း ပြီး ပြန်လည် ဆက်သွယ်ထား ပြီး အကြောင်းကြားချက် ပေးခြင်း အောင်မြင်သည်
PHP Mail လက်တွေ
PHP mail() ကုသမှု အကြောင်း ပိုမိုကြားရန် ကျွန်ုပ်၏ PHP Mail လက်တွေ ကို ခေါ်သွားပါ။
- အရှေ့စာလုံး PHP Sessions
- နောက်ပိုင်း စာလုံး PHP မှတ်ချက် E-mail