php වලින් mail එකක් යවන්නේ කොහමද

8 views
Skip to first unread message

Layan Maduka

unread,
Feb 5, 2012, 10:34:12 AM2/5/12
to tech...@googlegroups.com

මම පහත php  code එක දල mail එකක් සෙන්ඩ් වෙන්න හදන්න හැදුව මට එක කරගන්න බැරි උන උදව්වක් කරන්න පුලුවන්ද
( වෙබ් site එක හොස්ට් කලේ www .000webhost.com එකේ )
මේ සමග එම පගේ එක එවල තියනවා



(මේ php code එක ගත්තේ www.w3schools.com එකෙන් මට මේ code එකෙන් කෙරෙන දේත් පැහැදිලි කරන්න පුලුවන්ද  )


<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("laya...@gmail.com", "$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>
--
http://layan.info/

Autumn.rar

Kalinga Athulathmudali

unread,
Feb 5, 2012, 11:34:25 AM2/5/12
to tech...@googlegroups.com
2012/2/5 Layan Maduka <laya...@gmail.com>:

>
> මම පහත php  code එක දල mail එකක් සෙන්ඩ් වෙන්න හදන්න හැදුව මට එක කරගන්න බැරි
> උන උදව්වක් කරන්න පුලුවන්ද
> ( වෙබ් site එක හොස්ට් කලේ www .000webhost.com එකේ )
> මේ සමග එම පගේ එක එවල තියනවා

නොමිලේ දෙන හොස්ටින් වල මෙල් ෆන්ෂන් එක බාවිතා කරන්න දෙන්නේ නෑ.


--
කාලිංග ඇතුලත්මුදලි.
http://www.kalingasblog.com
Follow me on Twitter http://twitter.com/kalinga
තාක්ෂණය ඔබට අරියාදු කරනවාද? http://www.techkatha.com
සිංහල බ්ලොග් කියවමු http://blogs.sinhalabloggers.com
සිංහල Geek Chat http://techkatha.com/chat/

Harshana

unread,
Feb 5, 2012, 11:38:24 AM2/5/12
to tech...@googlegroups.com


2012/2/5 Layan Maduka <laya...@gmail.com>


මම පහත php  code එක දල mail එකක් සෙන්ඩ් වෙන්න හදන්න හැදුව මට එක කරගන්න බැරි උන උදව්වක් කරන්න පුලුවන්ද
( වෙබ් site එක හොස්ට් කලේ www .000webhost.com එකේ )
මේ සමග එම පගේ එක එවල තියනවා
 
පොඩ්ඩක් search කරල බලන්න message එකක් එවන්න ඉස්සෙල්ල. 


--
Cheers !,
හර්ෂණ | Harshana
http://Harshana.net
http://DevSmart.net

"I'm using Google before asking dumb questions. :)" 

Bimsara Walallawita

unread,
Feb 5, 2012, 12:11:00 PM2/5/12
to tech...@googlegroups.com
හැබැයි වර්ඩ්ප්‍රෙස් තියෙනවා නම් යවන්න පුලුවන් නේද? මම හිතන්නේ 000webhost support කරනවා. මම වර්ඩ්ප්‍රෙස් වල කරලා තියෙනවා.

2012/2/5 Harshana <wmhar...@gmail.com>

--
Techකතා SMS Update ලබාගන්න add ලෙස type කොට 0714712774 වෙත SMS කරන්න.
 
Techකතා Chat room එකට සෙට් වෙන්න http://techkatha.com/chat/
ටෙක්කතා සමූහය සඳහා ආචාර ධර්ම http://www.techkatha.com/rules-and-regulations/
 
ඔබට මෙම පණිවිඩය ලැබෙන්නේ ඔබ Teckකතා හි සාමාජිකයෙක් බැවිනි.
ලිවීම සඳහා tech...@googlegroups.com වෙත ලියන්න.
Teckකතා හින් ඉවත්වීම සඳහා http://googlegroups.com/group/techkatha/subscribe වෙත යන්න.
 
වෙබ් අඩවිය http://www.techkatha.com



--
Bimsara Walallawita
මගේ වෙබ් එක: My web: http://www.mytechnicals.info/
My blog: මගේ බ්ලොග් එක: http://sinhala.mytechnicals.info/
Follow me @ twitter : http://www.twitter.com/bwalallawita
ශ්‍රී ලාංකික අන්තර්ජාල ගනුදෙනුකරුවන්ගේ සංසදය: http://www.slicu.org
එහි බ්ලොග් අඩවිය: http://internetcustomerslk.blogspot.com
එහි ගූගල් සමූහය: http://groups.google.com/group/internetcustomerslk/





Malinda Prasad - මාලින්ද ප්‍රසාද්

unread,
Feb 5, 2012, 1:28:49 PM2/5/12
to tech...@googlegroups.com
පොඩ්ඩක් Manual SMTP Config වලට යවන්න බලන්න
Regards 
Malinda Prasadමාලින්ද ප්‍රසාද්
www.malindaprasad.com | blog.malindaprasad.com
Chat malinda555 malindaprasad  malin...@gmail.com
Contact Me GoogleFacebookEbayTwitterPicasaGoogle BuzzYoutubeWordpressBlog RSS



2012/2/5 Bimsara Walallawita <bwalal...@gmail.com>

Ranuka Perera

unread,
Feb 6, 2012, 11:59:51 AM2/6/12
to tech...@googlegroups.com
mail("laya...@gmail.com", "$subject", $message, "From:" . $email); තමයි mail එවන code එක.
mail( mail එක යවන  address එක, mail subject එක, mail body එක, "From:" . mail එකේ sender කියලා පෙන්නන address එක);

Regards,
Ranuka Perera



2012/2/5 Malinda Prasad - මාලින්ද ප්‍රසාද් <malin...@gmail.com>

Layan Maduka

unread,
Feb 7, 2012, 10:14:42 PM2/7/12
to tech...@googlegroups.com
ප්‍රථමයෙන් මා හට උදව් කල සියලුම දෙනාට සත්ති වෙමි


මා හට HTML  හෝ php පිලිබදව කිසිදු දැනුමක් නොමැත.
එම නිසා මට මෙම දේවල් තේරුම් ගැනීමට අපහසුය ,
හැකි කෙනෙක් ඉන්නවා නම් මම එවපු template එකට මේ code එක දල එවනවද mail එක සෙන්ඩ් උනාම තැන්ක්ස් කරලා ත් page එකක් එනවා නේද එකටත් පුළුවන් නම් හදල එවන්න.
එහෙම උනොත් මට එම code යොදපු විදිය බලල අයිඩියා එකක් ගන්න පුළුවන් වේවි



2012/2/6 Ranuka Perera <ran...@gmail.com>



--
http://layan.info/

Autumn.rar

Harshana

unread,
Feb 8, 2012, 12:30:27 AM2/8/12
to tech...@googlegroups.com


2012/2/8 Layan Maduka <laya...@gmail.com>

ප්‍රථමයෙන් මා හට උදව් කල සියලුම දෙනාට සත්ති වෙමි


මා හට HTML  හෝ php පිලිබදව කිසිදු දැනුමක් නොමැත.
එම නිසා මට මෙම දේවල් තේරුම් ගැනීමට අපහසුය ,
හැකි කෙනෙක් ඉන්නවා නම් මම එවපු template එකට මේ code එක දල එවනවද mail එක සෙන්ඩ් උනාම තැන්ක්ස් කරලා ත් page එකක් එනවා නේද එකටත් පුළුවන් නම් හදල එවන්න.
එහෙම උනොත් මට එම code යොදපු විදිය බලල අයිඩියා එකක් ගන්න පුළුවන් වේවි

Layan Maduka

unread,
Feb 11, 2012, 7:01:12 AM2/11/12
to tech...@googlegroups.com
ප්‍රථමයෙන් ම හට උදව් කල සියලු දෙනාට ස්තුති වෙමි . මම මගේ ගැටලුව සම්පුර්ණයෙන්ම විසදා ගත්ත, මන් වගේම programing පිලිබදව දැනුමක් නොමැති කෙනෙකුට කවද හෝ මෙය වැදගත් වෙයි සිතු නිසා විසදා ගත ක්‍රමය ලියන්න තීරණය කලා

@ හිතවත් කාලිංග අය්යේ  www .000webhost.com වල මෙල් ෆන්ෂන් එක වැඩ කරනවා


<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("laya...@gmail.com", "$subject",  මෙතනට ඔයාට mail එක එන්න ඕනේ address එක දන්න 
  $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'>  මම php file එක save කරලා තිබුනේ වෙන නමකින් එක මෙහි තියන නමම විය යුතුයි
  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>


2 ක්‍රමය

http://www.phpjabbers.com/make-contact-form-and-send-email-in-php-php21.html     මේකේ විස්තර තියනවා



<form action="test.php" method="post"> 
<table width="400" border="0" cellspacing="2" cellpadding="0"> 
<tr> 
<td width="29%" class="bodytext">Your name:</td> 
<td width="71%"><input name="name" type="text" id="name" size="32"></td> 
</tr> 
<tr> 
<td class="bodytext">Email address:</td> 
<td><input name="email" type="text" id="email" size="32"></td> 
</tr> 
<tr> 
<td class="bodytext">Comment:</td> 
<td><textarea name="comment" cols="45" rows="6" id="comment" class="bodytext"></textarea></td> 
</tr> 
<tr> 
<td class="bodytext">&nbsp;</td> 
<td align="left" valign="top"><input type="submit" name="Submit" value="Send"></td> 
</tr> 
</table> 
</form>
මේ code එක html විදියට save  කර ගන්න (මේක නම් ඕන නමක් උනාට කමක් නැහැ )

<?php 
$ToEmail = 'your...@site.com'; 
$EmailSubject = 'Site contact form '; 
$mailheader = "From: ".$_POST["email"]."\r\n"; 
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n"; 
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n"; 
$MESSAGE_BODY = "Name: ".$_POST["name"]."<br>"; 
$MESSAGE_BODY .= "Email: ".$_POST["email"]."<br>"; 
$MESSAGE_BODY .= "Comment: ".nl2br($_POST["comment"])."<br>"; 
mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure"); 
?>
මතක ඇතුව මේක test.php විදියට save කරගන්න ,වෙනස් කරන්න ඕනේ නම් දෙකේම වෙනස් කරන්න


2012/2/8 Harshana <wmhar...@gmail.com>
--
Techකතා SMS Update ලබාගන්න add ලෙස type කොට 0714712774 වෙත SMS කරන්න.
 
Techකතා Chat room එකට සෙට් වෙන්න http://techkatha.com/chat/
ටෙක්කතා සමූහය සඳහා ආචාර ධර්ම http://www.techkatha.com/rules-and-regulations/
 
ඔබට මෙම පණිවිඩය ලැබෙන්නේ ඔබ Teckකතා හි සාමාජිකයෙක් බැවිනි.
ලිවීම සඳහා tech...@googlegroups.com වෙත ලියන්න.
Teckකතා හින් ඉවත්වීම සඳහා http://googlegroups.com/group/techkatha/subscribe වෙත යන්න.
 
වෙබ් අඩවිය http://www.techkatha.com



--
http://layan.info/

Reply all
Reply to author
Forward
0 new messages