Skip to content

Имэйл илгээх үйлдэл

November 1, 2006

Вэбсофт Монгол ХХК-ын вэб боловсруулах программын эх кодыг та бүхэнд танилцуулж байна
function mail_send($name, $contact_mail,$email,$body ){
    
    $date=getdate();
    $today = $date[‘year’].”-“.$date[‘mon’].”-“.$date[‘mday’];
    
    $to = “$contact_mail <$contact_mail>” . “, “;
    /* subject */
    $subject = “Вэбийн хаяг : Санал хүсэлт : $name “;
    
    $message = ”
    <html>
    <head>
    <style1>Вэбийн хаяг ХОЛБОО БАРИХ хуудас</style1>
    </head>
    <body>
    <p><strong>Санал хүсэлт илгээсэн:</strong><br />
       $name</p>
    <table>
    <tr>
    <td>
    <strong>Санал хүсэлт:</strong>
     $body </td>
    </tr>
    <tr>
    <td>
    <strong>Илгээсэн огноо:</strong>
     $today <br />
    Вэбийн нэр</td>
    </tr>
    </table>
    </body>
    </html>
    “;
    
    $headers  = “WSMmail-Version: 1.2\r\n”;
    $headers .= “Content-type: text/html;  charset=utf-8\r\n”;
    $headers .= “WSMmail-Version: 1.0\r\n”;
    $headers .= “From: $email<“.$email.”>\r\n”;
    
    if(mail($to, $subject, $message, $headers))
    { // mail sent sss
    return true;
    } // mail sent eee
    else
    { // mail do not sent sss
    return false;
    } // mail do not sent eee
    }

One Comment leave one →
  1. February 27, 2008 9:00 am

    Энэ gmail ruu zugeer ochij chadaj baina uu.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: