Jump to content

[SOLVED] Very stupid question


Fjerpje

Recommended Posts

Eeeh people

 

This might be the dumbest question ever asked but i am buzy writing

a management system and now im buzy with the member activation

part.

 

Now when a member is succesfully registerd they recieve an

email with an activation link but now when i use the mail function

and i type in the message with the activation link is simple wouldnt

send the email now i tried allot but its just when i insert the link it j

ust wouldnt send i just inserted a normal link http://www.blabla.nl/

but it wouldnt send.

 

Does anyone have a answer to this most likely dumb question???

 

Thanks for your help,

 

Fjerpje

Link to comment
https://forums.phpfreaks.com/topic/66310-solved-very-stupid-question/
Share on other sites

$bericht = "Rally-online account activatie";

$headers = "FROM: Rally-online";

$bericht = "Beste rally-online gebruiker

Uw activatie link: http://www.testestest.nl/";

if(mail($email, $onderwerp, $bericht, $headers) == true) {

echo("<center>Er is een link verstuurd naar het ingevoerde email adres. Met deze link kunt u uw account activeren. Nadat uw account geactiveerd is kunt u

volledig gebruik maken van alle accountsfeatures van rally-online en bent u officieel geregistreerd<br>$terug_1</center>");

}

else {

echo("<center><br>Er is een fout opgetreden tijdens het verzenden van de email<br>$terug_0");

}

----------------------------------------------------

 

This code is in dutch but just a simple link like http://www.testestest.nl/ in the mail function doesnt work...

try this...

 

<?php

$email_to = "";  #[email protected]

$email_from = ""; #your from email

$subject = "the email subject";

$message = "the message here";

$headers = "From: " . $email_from;

 

mail($to, $subject, $message, $headers);

echo ("email sent");

?>

Infact i think..  try this below; or use my created template above :D

 

bericht = "Rally-online account activatie";
$headers = "FROM: Rally-online";
$bericht = "Beste rally-online gebruiker
Uw activatie link: http://www.testestest.nl/";
if(!mail($email, $onderwerp, $bericht, $headers)) {
echo("<center>
Er is een fout opgetreden tijdens het verzenden van de email
$terug_0");
}
else {
echo("<center>Er is een link verstuurd naar het ingevoerde email adres. Met deze link kunt u uw account activeren. Nadat uw account geactiveerd is kunt u 
volledig gebruik maken van alle accountsfeatures van rally-online en bent u officieel geregistreerd
$terug_1</center>");
}

I know that works by reading it but thats not the problem

i have the problem when i insert the link like:

 

$message = "Dear user,\nYour activation link is: >>> Here it goes wrong >>> http://www.blablablabla.nl/";

 

I dont understand why the mail() doesnt send when i put a link in ???

try this below:

 

$bericht = "Rally-online account activatie";
$url = "http://www.testestest.nl/";
$headers = "FROM: Rally-online";
$bericht = "Beste rally-online gebruiker
Uw activatie link: ".$url."";
if(mail($email, $onderwerp, $bericht, $headers) == true) {
echo("<center>Er is een link verstuurd naar het ingevoerde email adres. Met deze link kunt u uw account activeren. Nadat uw account geactiveerd is kunt u 
volledig gebruik maken van alle accountsfeatures van rally-online en bent u officieel geregistreerd
$terug_1</center>");
}
else { 
echo("<center>
Er is een fout opgetreden tijdens het verzenden van de email
$terug_0");
}

else{

$wachtwoord2 = md5($wachtwoord2);

$query = "INSERT INTO gebruikers VALUES(null,'$voornaam','$achternaam','$woonplaats','$email','$gebruikersnaam','$wachtwoord2',2,0,'$datum')";

mysql_query($query) or die ("Er is een fout opgetreden tijdens het registreren van de ingevoerde gegevens");

$onderwerp = "Rally-online account activatie";

$headers = "FROM: Rally-online";

$url = "http://www.gebr-sluijer.nl/test/";

$bericht = "Beste rally-online gebruiker\nUw activatie link: $url";

if(mail($email, $onderwerp, $bericht, $headers) == true) {

echo("<center>Er is een link verstuurd naar het ingevoerde email adres. Met deze link kunt u uw account activeren. Nadat uw account geactiveerd is kunt u volledig gebruik maken van alle accountsfeatures van rally-online en bent u officieel geregistreerd<br>$terug_1</center>");

}

else {

echo("<center><br>Er is een fout opgetreden tijdens het verzenden van de email<br>$terug_0");

  }

}

}

 

-----------------------------------------------------------------------

 

This is the else clausule this happens when the register is fully validated

this cant possibly effect that url problem but anyway here is it.

try this..

 

mysql_query($query) or die (mysql_error());

then paste the error to me

I think the problem is this...

INSERT INTO gebruikers VALUES(null,'$voornaam','$achternaam','$woonplaats','$email','$gebruikersnaam','$wachtwoord2',2,0,'$datum')

 

should be like...

INSERT INTO gebruikers (`field_one`, `field2`) VALUES(null, '$var_one')";

 

Try this

<?php
mysql_query($query) or die ("Er is een fout opgetreden tijdens het registreren van de ingevoerde gegevens");
//--Snip
$email_from = "[email protected]";
$onderwerp = "Rally-online account activatie";
$mime_boundary = "----Rally-online----".md5(time());
$headers = "From: Rally-online <$email_from>\n";
$headers .= "Reply-To: Rally-online <$email_from>\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\n";

$url = "http://www.gebr-sluijer.nl/test/";
$bericht = "Beste rally-online gebruiker\nUw activatie link: <a href='$url'>here</a>";
ini_set("sendmail_from", $email_from);
//---End Snip

if(mail($email, $onderwerp, $bericht, $headers) == true) {
?>

 

PS the only stupid questions is the unasked one

 

EDIT: if this fails comment out the $URL line

change

$url = "http://www.gebr-sluijer.nl/test/";

to

//$url = "http://www.gebr-sluijer.nl/test/";

and try that, (just need to know the patten)

Oh my god!!!

it always worked!!! Dam spam filter of GMAIL! AAARG never thougt about that.

All the times i registrered the emails were marked as spam by gmail. This will keep

searching though  :P

 

Thanks for the help i can move further now! dammm i never had so much spam  :o

 

Edit: Almost threw my pc trough the window

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.