Jump to content

sending mail using php


bbala
 Share

Recommended Posts

hi all, my site needs to send a conformation email for the users who register. But my server doesnt have a mailer configured.. Is there any way to send mails without a mail server? Is there any way to use gmail from the code to send mails??another doubt. how do i redirect to a page from one page using php??

Link to comment
Share on other sites

You need to use a mail server to send mails. You don't need to have a mail server installed on the web server, but you need to use a mail server to send mails. If you want to use another mail server you will have to change the configuration options before you send the mail to use the server you want to use. I don't know if the GMail SMTP server is available for public use. Look at the options on this page:http://www.php.net/manual/en/ref.mail.phpIf you want to change the mail server to mail.domain.com before you send a mail you would do this:ini_set("SMTP", "mail.domain.com");mail(...);That will only work on Windows servers. For Linux servers you'll want to use something else. I found this comment on the mail reference page:

It is a common problem for all using php mail function. To solve this thereare so many answers I have seen in the internet and they do not hit problemcorrectly.Actually the problem here is if we send mails using php mail function we donot have a signature and other mailing systems thinks that we are spamers.So the solution is using a free remote smtp host like gmail to send our mails.It is not hard because we have a free php smtp project called PHPMailer. You can download it from http://sourceforge.net/project/showfiles.php?group_id=26031 .You do not need to install it on your server.It is very easy to understand how it is used to send mails using exampleszipped with PHPMailer. The following code is to send emails using gmail andto do that you have to have a gmail mail account. Which can easily be createdby visiting http://gmail.com. Your mails willsend using that mail account and they will never become spams...To see the complete code for sending emails use following linkhttp://bestdeveloper.blogspot.com
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...