Salut là
J'ai été de lecture des réponses différentes sur l'envoi d'e-mails sur le serveur WAMP, mais aucun n'a réellement penchée sur les critères d'utilisation d'un nom d'utilisateur et mot de passe.
j'ai installé WAMP et suis en mesure de présenter les formulaires de ma base de données. J'ai modifié mon fichier php.ini pour inclure le codage smtp. Je ne sais pas où mettre le nom d'utilisateur et mot de passe car cela est absolument nécessaire pour moi d'envoyer des emails. il est une exigence du serveur i am using. il ne veut pas coopérer à moins que. ma question est où dois-je mettre le nom d'utilisateur et mot de passe?
Il s'agit d'insérer dans la base de données:
$query = "INSERT INTO partybookingform (pgname, address, postcode, homecontactnum, mobilecontactnum, emailaddress, birthdaychildname, childbirthday, partytype, price, dateofparty, numofpartyguests, additionalnotes) VALUES ('$pgname', '$address', '$postcode', '$homecontactnum', '$mobilecontactnum', '$emailaddress', '$birthdaychildname', '$childbirthday', '$partytype', '$price', '$dateofparty', '$numofpartyguests', '$additionalnotes')";
mysql_query($query) or die(mysql_error());
- $query = "INSERT INTO partybookingform (pgname, address, postcode, homecontactnum, mobilecontactnum, emailaddress, birthdaychildname, childbirthday, partytype, price, dateofparty, numofpartyguests, additionalnotes) VALUES ('$pgname', '$address', '$postcode', '$homecontactnum', '$mobilecontactnum', '$emailaddress', '$birthdaychildname', '$childbirthday', '$partytype', '$price', '$dateofparty', '$numofpartyguests', '$additionalnotes')";
- mysql_query($query) or die(mysql_error());
i extrait dernier code utilisé était le suivant:
$smtp_server = "192.6.1.4";
$port = 25;
$mydomain = "dcobbinah.co.uk";
$username = "username"; // MS Exchange servers will probably require a valid NT domain name as part of the username. E.g., "ntdomain\user"
$password = "password";
$sender = "$emailaddress";
$recipient = "dcobbinah@hamleys.co.uk";
$subject = "test";
$content = "This is what you submitted:\n\n\nParent or Guardian Name: ".($_POST['pgname'])."\nAddress: ".($_POST['address'])."\nPost Code: ".($_POST['postcode'])."\n\nHome Contact Number: ".($_POST['homecontactnum'])."\n\nMobile Number: ".($_POST['mobilecontactnum'])."\n\nEmail Address: ".($_POST['emailaddress'])."\n\nBirthday Child's Name: ".($_POST['birthdaychildname'])."\n\nChild's Birthday: ".($_POST['childbirthday'])."\n\nType Of Party: ".($_POST['partytype'])." \n\nPrice".($_POST['price'])."\n\nDate Of Party: ".($_POST['dateofparty'])."\n\nNumber of Guests: ".($_POST['numofpartyguests'])." \n\nAny Additional Notes: ".($_POST['additionalnotes'])."\n\n\n\nRegards,\n\n\nDanny";
// Initiate connection with the SMTP server
$handle = fsockopen($smtp_server,$port);
fputs($handle, "EHLO $mydomain\r\n");
// SMTP authorization
fputs($handle, "AUTH LOGIN\r\n");
fputs($handle, base64_encode($username)."\r\n");
fputs($handle, base64_encode($password)."\r\n");
// Send out the e-mail
fputs($handle, "MAIL FROM:<$sender>\r\n");
fputs($handle, "RCPT TO:<$recipient>\r\n");
fputs($handle, "DATA\r\n");
fputs($handle, "To: $recipient\n");
fputs($handle, "Subject: $subject\n\n");
fputs($handle, "$content\r\n");
fputs($handle, ".\r\n");
// Close connection to SMTP server
fputs($handle, "QUIT\r\n");
- $smtp_server = "192.6.1.4";
- $port = 25;
- $mydomain = "dcobbinah.co.uk";
- $username = "username"; // MS Exchange servers will probably require a valid NT domain name as part of the username. E.g., "ntdomain\user"
- $password = "password";
- $sender = "$emailaddress";
- $recipient = "dcobbinah@hamleys.co.uk";
- $subject = "test";
- $content = "This is what you submitted:\n\n\nParent or Guardian Name: ".($_POST['pgname'])."\nAddress: ".($_POST['address'])."\nPost Code: ".($_POST['postcode'])."\n\nHome Contact Number: ".($_POST['homecontactnum'])."\n\nMobile Number: ".($_POST['mobilecontactnum'])."\n\nEmail Address: ".($_POST['emailaddress'])."\n\nBirthday Child's Name: ".($_POST['birthdaychildname'])."\n\nChild's Birthday: ".($_POST['childbirthday'])."\n\nType Of Party: ".($_POST['partytype'])." \n\nPrice".($_POST['price'])."\n\nDate Of Party: ".($_POST['dateofparty'])."\n\nNumber of Guests: ".($_POST['numofpartyguests'])." \n\nAny Additional Notes: ".($_POST['additionalnotes'])."\n\n\n\nRegards,\n\n\nDanny";
- // Initiate connection with the SMTP server
- $handle = fsockopen($smtp_server,$port);
- fputs($handle, "EHLO $mydomain\r\n");
- // SMTP authorization
- fputs($handle, "AUTH LOGIN\r\n");
- fputs($handle, base64_encode($username)."\r\n");
- fputs($handle, base64_encode($password)."\r\n");
- // Send out the e-mail
- fputs($handle, "MAIL FROM:<$sender>\r\n");
- fputs($handle, "RCPT TO:<$recipient>\r\n");
- fputs($handle, "DATA\r\n");
- fputs($handle, "To: $recipient\n");
- fputs($handle, "Subject: $subject\n\n");
- fputs($handle, "$content\r\n");
- fputs($handle, ".\r\n");
- // Close connection to SMTP server
- fputs($handle, "QUIT\r\n");
ce code particulier ne fonctionne pas du tout. il n'envoie pas d'e-mails à l'expéditeur du tout, il soumet à la base de données qui est génial. aucune aide sur ce s'il vous plaît?