Jump to content

NEED HELP on Verifying email address project.


loudog

Recommended Posts

Hey guy's, Im working on how to verify an email address. i dont have  my own web site so i keep getting the following errors:Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\GuestBook\signup_ac.php on line 40 and  Undefined variable: sentmail in C:\wamp\www\GuestBook\signup_ac.php on line 49 . I've read that you can actually can don it without having you're on site. If anyone can show me how to do it or tell me what im doing wrong that would be awesome.

 

                                                                                                                                                thanks in advance

                                                                                                                                                            loudog

HERE is the code.

 

page1

sginup.php

<html>

<head>

 

</head>

<body>

<table width="350" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td><form name="form1" method="post" action="signup_ac.php">

<table width="100%" border="0" cellspacing="4" cellpadding="0>

<tr>

<td colspan="3"><strong>Sign up</strong></td>

</tr>

<tr>

<td width="76">Name</td>

<td width="3">:</td>

<td width ="305"><input type="text" name="name" id="name" size="30"></td>

</tr>

<tr>

<td>E-mail</td>

<td>:</td>

<td><input type="text" name="email" id="email" size="30"></td>

</tr>

<tr>

<td>Password</td>

<td>:</td>

<td><input type="password" name="password" id="password" size="30"></td>

</tr>

<tr>

<td>Country</td>

<td>:</td>

<td><input type="country" name="country" id="country" size="30"></td>

</tr>

<tr>

<td> </td>

<td> </td>

<td><input type="submit" name="sub" id="sub" value="Submit">  

<input type="reset" name="reset" id="reset" value="Reset"></td>

</tr>

</table>

</form></td>

</tr>

</table>

</body>

</html>

 

 

page 2

signup_ac.php

<?php

include('config.php');

 

//table name

$tbl_name='temp_members';

 

//Random confirmation code

$confirm_code=md5(uniqid(rand()));

 

//values sent from form

$name=$_POST['name'];

$email=$_POST['email'];

$country=$_POST['country'];

$password=$_POST['password'];

//Insert Data into database

//$sql="INSERT INTO $tbl_name(confrim_code,name,email,password,country)VALUES('$confirm_code','$name','$emailid','$pwd','$country')";

$sql="INSERT INTO $tbl_name(confirm_code, name, email, password, country)VALUES('$confirm_code', '$name', '$email', '$password', '$country')";

 

$result=mysql_query($sql);

 

//If suceesfully inserted data into database, send confirmation link to email

if($result)

{

 

//Send e-mail to..

$to=$email;

 

//Your subject

$subject="Your confirmation link here";

 

//From

$header="from:your name<your email>";

 

//Your message

$message="Your confirmation link \r\n";

$message="Click on this link to activate your account \r\n";

$message="http://www.yourweb.com/confirmation.php?passkey=$confirm_code";

 

//send email

this line 40->$sentemail=mail($to,$subject,$message,$header);

}

 

//If not found

else{

echo "Not found your email in our database";

}

 

//If your email succesfully sent

 

this is line 49->if($sentmail){

echo "Your Confirmation link Has Been Sent To Your Email Address.";

}

else{

echo"Cannot send Confirmation link to your email Address.";

}

?>

Link to comment
Share on other sites

You probably havent set up your outgoing mail server on your localhost. I can see from your error you are on a windows machine using wamp.  What you need to do is amend your php.ini file to allow for smtp(simple mail transfer protocol - outgoing mail). If you find your php.ini, look for SMTP. It will most likely be set to localhost ( smtp=localhost). Change this to your ISP's outgoing mail server address : i.e smtp.bt.com.

 

Secondly search for smtp_port and make sure it says smtp_port = 25.

 

restart your apache and retry.

 

good luck

 

 

Link to comment
Share on other sites

well that sound  easy and i bet it is.  :-[ but would you mind telling me how do i find SMTP in the php.ini file and amend it as well. in other words a step by step guide on how to set up a mail server would be appreciated.

 

                                                                                                                                      thanks in advance

                                                                                                                                    loudog

Link to comment
Share on other sites

I thought I was [pretty clear in my last post, but I'm not one the leave someone stranded lol. So here you go.

Firstly left click on on the wamp icon in your system tray and select php from the menu, then php.ini from the sub menu:

See attachment.

 

this will open up the php.ini file in notepad. use control + F to search the document and search for [mail function]. This should show you the mail section of the document:

[mail function]

; For Win32 only.

; http://php.net/smtp

SMTP = localhost

; http://php.net/smtp-port

smtp_port = 25

 

change this to whatever your isp's outgoing mail server is:

 

[mail function]

; For Win32 only.

; http://php.net/smtp

SMTP = smtp.bt.com

; http://php.net/smtp-port

smtp_port = 25

 

 

save the file and restart your wamp

 

 

[attachment deleted by admin]

Link to comment
Share on other sites

I don't have internet i use wireless thru someone else in my apartment complex  cuz its an unlocked connection. honestly i don't even know who it belongs to  i just know that his internet provider is qwest. so i did the following and i still got the error.

 

[mail function]

; For Win32 only.

SMTP = qwest

smtp_port = 25

 

; For Win32 only.

; http://php.net/sendmail-from

sendmail_from = dan@qwest.com

Link to comment
Share on other sites

I don't have internet i use wireless thru someone else in my apartment complex  cuz its an unlocked connection. honestly i don't even know who it belongs to  i just know that his internet provider is qwest. so i did the following and i still got the error.

 

[mail function]

; For Win32 only.

SMTP = qwest

smtp_port = 25

 

; For Win32 only.

; http://php.net/sendmail-from

sendmail_from = dan@qwest.com

 

 

I have change the settings in the php,.ini file and i still get the damn error:Warning: mail() [function.mail]: Failed to connect to mailserver at "71.210.196.246" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\GuestBook\mail.php on line 7

 

New settings

[mail function]

; For Win32 only.

SMTP = 71.210.196.246

smtp_port = 25

 

; For Win32 only.

; http://php.net/sendmail-from

sendmail_from = pea6n@yahoo.com

 

I still get the error

 

Link to comment
Share on other sites

i don't have a host like godaddy or anything like that. all i have been trying is to configure the php.ini file tosend mail. Im starting to get to the point where i feel like unless i know the isp address there is no use to even configure that file.  In other words i have to get a server from go daddy or somthing. RIght?

Link to comment
Share on other sites

Ok, I think you are missing the point slightly. You do not use your ISP's I.P address as an email server. You use the ips's email server as an email server !!!!.

Now as you stated:

I don't have internet i use wireless thru someone else in my apartment complex  cuz its an unlocked connection. honestly i don't even know who it belongs to  i just know that his internet provider is qwest. so i did the following and i still got the error.

So I am not going to give you the mail server settings for qwest as the connection is not owned by You, and if i found someone else using my internet connection as a mail server i wouldnt be too happy.

 

But a quick google for qwest outgoing mail servers will point you in the right direction.

 

But what i really advise is for you to go online an get yourself some hosting.

 

All the setup info you need to get this working is in the previous posts i sent you, yet you have not followed the information correctly once. So PLEASE READ THE POST THOUROUGHLY before we start going round in circles.

 

I am trying to help you as much as possible, but your not giving me much to work with

Link to comment
Share on other sites

Hey gristoi, i really appreciate ur patience and the fact that your taking the time out of your schedule  to help me with this issue. But like you said, i think i was missing the point  by trying to go around the fact that i needed an isp address something i don't have.  so i think im just gonna purchse  some hosting  form go daddy and  be done

 

 

ps.... the internet stuff your right. Im moving out in a week so there is no point in changing my actual internet to wireless.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.