Php වලින් E-Mail එකක් යවන්නේ කොහොමද?
එලකිරියට අවේ ගොඩක් දවසකින්.
මගෙ degree එකේ වැඩ හින්ද ගොඩක් වෙලාවට ඇවිත් යනවා විතරයි අලුතෙන් පොස්ට් එකක්වත් දාන්න බැරි උනා. තව වැඩි දවසක් නෑ, මේ මාසෙන් සේරම ඉවරයි.
මට Php දන්නා කෙනෙක්ගෙන් පොඩි උදව්වක් ඕන. මේ දවස් වල මගෙ final Project එක කරගෙන යනවා. පොඩි වෙබ් based System එකක්. මට ඒකෙදි user කෙනෙක් register උන ගමන් එයාගේ User name , Password එයාගේ මේල් එලට e-mail කරන ඕන.
(User name - එයාගේ NIC එක , Password එකනම් Auto create කරනවා)
මට php email function එක හරියට වැඩ කරවගන්න බෑ.
PHPMailer එකෙන් යැව්වොත් මේ වගේ code ekak enne.
$mail->Port = 465; // or 587 හරිද?
වෙන ලේසි විදියක් තියනවද?
pls මට ඉක්මන් විසදුමක් ඕන........
ජයවේවා......
මගෙ degree එකේ වැඩ හින්ද ගොඩක් වෙලාවට ඇවිත් යනවා විතරයි අලුතෙන් පොස්ට් එකක්වත් දාන්න බැරි උනා. තව වැඩි දවසක් නෑ, මේ මාසෙන් සේරම ඉවරයි.
මට Php දන්නා කෙනෙක්ගෙන් පොඩි උදව්වක් ඕන. මේ දවස් වල මගෙ final Project එක කරගෙන යනවා. පොඩි වෙබ් based System එකක්. මට ඒකෙදි user කෙනෙක් register උන ගමන් එයාගේ User name , Password එයාගේ මේල් එලට e-mail කරන ඕන.
(User name - එයාගේ NIC එක , Password එකනම් Auto create කරනවා)
මට php email function එක හරියට වැඩ කරවගන්න බෑ.
PHPMailer එකෙන් යැව්වොත් මේ වගේ code ekak enne.
<?php
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
$mail->Host = "smtp.gmail.com";
$mail->Port = 465; // or 587
$mail->IsHTML(true);
$mail->Username = "[email protected]";
$mail->Password = "password";
$mail->SetFrom("[email protected]");
$mail->Subject = "Test";
$mail->Body = "hello";
$mail->AddAddress("[email protected]");
if(!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message has been sent";
}
?>
මම dongle එකකින් නෙට් එන්නේ. ඒකට ඔය $mail->Host = "smtp.gmail.com";$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
$mail->Host = "smtp.gmail.com";
$mail->Port = 465; // or 587
$mail->IsHTML(true);
$mail->Username = "[email protected]";
$mail->Password = "password";
$mail->SetFrom("[email protected]");
$mail->Subject = "Test";
$mail->Body = "hello";
$mail->AddAddress("[email protected]");
if(!$mail->Send())
{
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message has been sent";
}
?>
$mail->Port = 465; // or 587 හරිද?
වෙන ලේසි විදියක් තියනවද?
pls මට ඉක්මන් විසදුමක් ඕන........
ජයවේවා......

