Jump to content

formulario de contacto sin function mail


Recommended Posts

tengo mi host gratis y la funcion mail no esta activa solo tengo activado el sistema smtp que no lo entiendo mucho si alguien me ayuda

 

tengo el sgte y creo q no se insertarlo porque me sale un error

 

<?php

$smtp_server = "mail.mymailserver.com";
$mydomain = "any_text_here";


//get the following info from your mail server eg. au.yahoo.com

$port = 25; //SMTP PORT of mail.mymailserver.com
$username = "myusername"; $password = "mymail_password";


$sender = "[email protected]";

/*
Most respectable mail servers will reject outgoing mail
if $sender e-mail address does not belong to $username
*/

$sender_name = "My Name"; //Any name you fancy


$recipient = "[email protected]";
$subject = "the subject";
$content = "the message";

// SMTP connection

$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, "From: $sender_name<$sender>\r\n");

//you can use different e-maill address in above line, but most spam blockers will suspect this

fputs($handle, "To: $recipient\r\n");
fputs($handle, "Subject: $subject\r\n");
fputs($handle, "$content\r\n");
fputs($handle, ".\r\n");

//Don't ignore the period "." in line above. This indicates the end of your mail

// Close connection to SMTP server
fputs($handle, "QUIT\r\n");
?>

 

alguien me ayuda

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