Heloo every body

I m a coder new to PHP i need of a person who can give me instruction what i hv to do i m expalining my problem as follow

"i m going to make a web site for my customer. I have to provide email alerts for reminder to the members of his web. can any body tell me what i hv to ask hime to do and what i hv to do (i mean that he have a domain name and a host he have to get smtp server address sepratly or smtp.hisdomainanme.com will work

while helping me keep in mind i hv tried allot of example in PHP mail but they not work for me following is the code in C# that works 100% but i dont know how to do in PHP

////////////////////
public string sendMail (string from, string to, string cc, string bcc, string subject, string body)
{
// Mail initialization
MailMessage mailMsg = new MailMessage();
mailMsg.From = from;
mailMsg.To = to;
mailMsg.Cc = cc;
mailMsg.Bcc = bcc;
mailMsg.Subject = subject;
mailMsg.BodyFormat = MailFormat.Text;
mailMsg.Body = body;
mailMsg.Priority = MailPriority.High;
// Smtp configuration
SmtpMail.SmtpServer = "smtp.gmail.com";
// - smtp.gmail.com use smtp authentication
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "maltafmalik@gmail.com");
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "mypassword");
// - smtp.gmail.com use port 465 or 587
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "465");
// - smtp.gmail.com use STARTTLS (some call this SSL)
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", "true");

}
\\\\\\

waiting for your response.......

    malikaltaf, I've moved your post into its own thread. In the future, please don't post your problem in someone else's thread - it's called "thread hijacking" and is generally frowned upon.

    As to your issue, PHP's native [man]mail/man function doesn't support SMTP authentication. As such, you'll need to use a 3rd-party PHP class that supports this feature. I've used PHPMailer in the past, but I've also heard people recommend XPertMailer instead.

      You need to configure a local MTA to accept messages from PHP then relay them via the server which requires authentication.

      Sending messages directly using SMTP from PHP is a very bad idea as there's no provision for retrying if the host is down.

      Just set up a local MTA - you can also test this very easily by manually trying to relay messages from it.

      Mark

        Write a Reply...