phpMailer not sending emails with no errors - phpmailer

I'm having this issue regarding sending emails using phpMailer
My code is
public function sendEmailNovoUtilizador($nome, $email){
$mail = new PHPMailer;
$mail->SMTPDebug = 1;
$mail->isSMTP();
$mail->Host = 'xxxxx.xxxxxxx.pt';
$mail->SMTPAuth = true;
$mail->Username = 'xxxxxxx#xxxxxx.edu.pt';
$mail->Password = 'xxxxxxx';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
$mail->setFrom('xxxxxxx#xxxxxx.edu.pt', 'Diretor');
$mail->addAddress($email, 'Novo utilizador');
$mail->IsHTML(true);
$mail->Subject = 'Registo de um novo utilizador';
$mail->CharSet = 'UTF-8';
$mail->Body = "
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
</head>
<body>
<h1>Novo Utilizador</h1>
<p>Seguem os seus dados</p>
<table>
<tbody>
<tr>
<td><strong>Nome:</strong></td>
<td>$nome</td>
</tr>
<tr>
<td><strong>Email:</strong></td>
<td>$email</td>
</tr>
</tbody>
</table>
<p> </p>
<p>Aguarde a validação por parte do Diretor</p>
<p> </p>
<p>Equipa ESMAIOR.</p>
<p> </p>
<p>Obrigado</p>
</body>
</html>";
$mail->addAttachment('../img/logo_pdf.jpg');
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
}
}
Error i get when i log into my server
Delivery Event Details
Event: failure
User: ebspma
Domain: xxxx.edu.pt
Sender: xxxxxx#xxxx.edu.pt
Sent Time: Sep 2, 2016 10:56:22 PM
Sender Host: xxxxxx.edu.pt
Sender IP: 109.71.40.19
Authentication: dovecot_login
Spam Score: 0
Recipient: xxxxxxx#gmail.com
Delivery User:
Delivery
Domain:
Delivered To:
Router: smarthost_cleanmx_regular
Transport: remote_smtp_cleanmx_smart_regular
Out Time: Sep 2, 2016 10:56:22 PM
ID: 1bfwS2­002VOU­Q4
Delivery Host: smtp.cleanmx.pt
Delivery IP: 130.185.80.200
Size: 6.52 KB
Result:
DHE­RSA­AES256­SHA:256 CV=yes DN="/OU=Domain Control
Validated/CN=*.cleanmx.pt": SMTP error from remote mail server after MAIL FROM:
<xxxxxx#xxxxx.edu.pt> SIZE=7818: 550­ Verification failed for
<xxxxxx#xxxx.edu.pt>\n550­Previous (
What's wrong, it seems it connect but can't delivery? This is what i get from my server log in email delivery

Related

Getting finished with status code: 204 on Firebase Function and nothings happened

I am developing a function to send email to customers.
exports.sendRestockingNotification = functions.https.onCall((data) => {
try {
console.log("Sending confirmation email to the customer...");
sendEmailRestocking(data.numero, data.nombre, data.emails);
} catch (error) {
console.error("Unexpected error: ", error);
}
});
function sendEmailRestocking (numero, nombre, emails) {
console.log("Sending Email...");
return transport.sendMail({
from: "XXXXX <xxxxxxxxxxxxx#gmail.com>",
to: emails,
subject: "El artículo " + nombre + " (" + numero + ") vuelve a estar disponible.",
html:
`
<div class="container rounded" style="padding: 10px 30px;">
<div class="container rounded" style="background-color: #0bbe83;">
<h1 style="color: white; padding: 5px;">TejidosPulido</h1>
</div>
<div class="row" style="padding: 10px 50px;">
<h5 style="color: #0bbe83;">Hola, </h5>
<p>
El artículo ${nombre} (${numero}) vuelve a estar disponible. ¡Date prisa antes de que se termine!
</p>
</div>
<br>
<p style="padding: 10px 30px;">
Un saludo,
<br>
Tu equipo TejidosPulido
</p>
</div>
`,
});
}
But I am always getting the same in the Firebase Functions console and any mail is sent and the debug message console.log("Sending a confirmation email to the customer..."); is not showed neither:
sendRestockingNotification -> Function execution started
sendRestockingNotification -> Function execution took 14 ms, finished with status code: 204
Have a look at the doc for Callable Cloud Functions. You need to return data that can be JSON encoded.
So you need to wait for the asynchronous sendEmailRestocking() function to terminate before sending a response. For example with the following adaptations:
exports.sendRestockingNotification = functions.https.onCall(async (data) => { // See async
try {
console.log("Sending confirmation email to the customer...");
await sendEmailRestocking(data.numero, data.nombre, data.emails);
return {result: "mail send"}; // For example
} catch (error) {
// See https://firebase.google.com/docs/functions/callable#handle_errors
console.error("Unexpected error: ", error);
}
});

phpmailer stopped working Mailer Error: Fatal error: Uncaught Error: Class 'PHPMailer' not found

My mailer stopped working and I cant get it to work again. I downloaded the newest phpmailer 5.5 from githhub and recodeded the page . I used the examples to create my mailer and created my form and when I turned on error reporting I cant figure this error out. I looked at examples on ur site and the did not work i trued to use
Fatal error: Class 'PHPMailer' not found
my server is using PHP Version 7.3.15 with the corna virus this is essential for me to stay aflot can u help me???
<!DOCTYPE html>
<html lang="en" class="no-js">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<head>
<meta charset="utf-8">
<title>test | semndinbg mail</title>
<link rel="stylesheet" href="css/repairstatus.css" type="text/css" />
<link rel="stylesheet" href="css/style.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<form id="form_1130906" class="appnitro" method="post" action="">
<div id="contact_slide1">
<div id="contact_name">FULL NAME: *<br>
<input id="element_4" name="name" class="element text medium" type="text" maxlength="50" value="" placeholder="FULL NAME"/></div>
<div id="contact_phone">PHONE NUMBER: *<br>
<input id="element_2_1" name="phone" class="element text" size="15" maxlength="15" value="" type="text" placeholder="PHONE NUMBER"></div>
</div> <!--contact_slide1-->
<div id="contact_slide2">
<div id="contact_email">VEHICLE MAKE: *<br>
<input id="element_1" name="email" class="element text medium" type="text" maxlength="40" value="" placeholder="Ex: FORD"/></div>
<div id="contact_contact">VEHICLE MODEL: *<br>
<input id="element_1" name="email" class="element text medium" type="text" maxlength="40" value="" placeholder="Ex: TAURUS"/></div>
</div> <!--contact_slide2-->
<div id="contact_message">MESSAGE:<br>
<textarea id="element_3" name="message" class="element textarea medium" placeholder="START TYPING MESAGE HERE..."></textarea></div>
<div id="contact_slide3">
<input id="saveForm" class="button_text" type="submit" name="submit" value="SEND" />
</div><!--contact_slide3-->
</form>
<?php
if (isset($_POST['submit'])){
//check if post form was submitted
if(isset($_POST)){
//check if hidden value was used
if(isset($_POST['miles']) && trim($_POST['miles']) !=''){
die('THERE WAS AN ERROR');
}
//implode all the post data and check against bad words in a text file
$my_bad_file = "inc/words.txt"; //make a new file and insert any bad items one per line, Phrases work as well
if(!file_exists($my_bad_file)){
die("Can't find $my_bad_file");
}
$check_content = implode(",", $_POST);
$bad_content_array = array_map('rtrim', file($my_bad_file));
foreach ($bad_content_array as $bad_content) {
$bad_content = strtolower($bad_content);
if (strpos(strtolower($check_content), $bad_content) !== false) {
die('THERE WAS A BAD ERROR');
}}
}
echo "Mailer Error:" . $mail->ErrorInfo;
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require("inc/PHPMailer2/src/PHPMailer.php");
require("inc/PHPMailer2/src/SMTP.php");
$mail = new PHPMailer/PHPMailer/PHPMailer();
$mail->IsSMTP(); // enable SMTP
//Create a new PHPMailer instance
$mail = new PHPMailer;
//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Enable SMTP debugging
// SMTP::DEBUG_OFF = off (for production use)
// SMTP::DEBUG_CLIENT = client messages
// SMTP::DEBUG_SERVER = client and server messages
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
//Set the hostname of the mail server
$mail->Host = 'smtp.gmail.com';
// use
// $mail->Host = gethostbyname('smtp.gmail.com');
// if your network does not support SMTP over IPv6
//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
$mail->Port = 587;
//Set the encryption mechanism to use - STARTTLS or SMTPS
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Username to use for SMTP authentication - use full email address for gmail
$mail->Username = 'test#gmail.com';
//Password to use for SMTP authentication
$mail->Password = 'aaaa1111';
//Set who the message is to be sent from
$mail->setFrom('from#example.com', 'First Last');
//Set an alternative reply-to address
$mail->addReplyTo('replyto#example.com', 'First Last');
//Set who the message is to be sent to
$mail->addAddress('whoto#example.com', 'John Doe');
//Set the subject line
$mail->Subject = 'PHPMailer GMail SMTP test';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), __DIR__);
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//Attach an image file
$mail->addAttachment('images/phpmailer_mini.png');
$mail->AddAddress('test#test.com');
$mail->Priority = 1;
$mail->WordWrap = 50; // set word wrap
$mail->IsHTML(true); // send as HTML
$mail->Subject = "FINE LINE AUTO BODY | Repair Status";
$mail->AltBody = "This is the text-only body";
$name = isset($_POST['name']) ? $_POST['name'] : '';
$phone = isset($_POST['phone']) ? $_POST['phone'] : '';
$make = isset($_POST['make']) ? $_POST['make'] : '';
$model = isset($_POST['model']) ? $_POST['model'] : '';
$message = isset($_POST['message']) ? $_POST['message'] : '';
$email = isset($_POST['email']) ? $_POST['email'] : '';
$phone = isset($_POST['phone']) ? $_POST['phone'] : '';
// gets info from form
$name = $_POST['name'] ;
$phone = $_POST['phone'] ;
$make = $_POST['make'] ;
$model = $_POST['model'] ;
$message = $_POST['message'] ;
$ip = $_SERVER["REMOTE_HOST"] ?: gethostbyaddr($_SERVER["REMOTE_ADDR"]);
// defines how message looks in email
$mail->Body="
<html>
<head>
</head>
<body>
<center>
<span style='color:red;'>This is from a customer, We are repairing his vehicle. Lets not keep them waiting!</span>
<div style='width:750px;text-align:center;'>
<div style='float:;'>
<span style='font-size:px;'><b>Personal Info</b><br></span>
<br>
<span style='font-size:px;'>---------------<br></span>
<br>
<span style='font-size:px;'>Full Name: $name<br></span>
<br>
<span style='font-size:px;'>Phone Number: $phone<br></span>
<br>
<span style='font-size:px;'>Vehicle Make: $make<br></span>
<br>
<span style='font-size:px;'>Vehicle Model: $model<br></span>
<br>
<span style='font-size:px;'>Message: $message<br></span>
</div></div>
</center>
</body>
</html>
";
// looks good in your inbox
//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error:" . $mail->ErrorInfo;
} else {
echo '<meta http-equiv="refresh" content="0;url=https://www.sucess.com/">';
}}
?>
</body>
</html>
You're doing the same thing twice, but incorrectly (and unnecessarily) the second time.
This method of creating an instance is correct for PHPMailer 6.0 and later (though you can make it look better by using an alias). Note the direction of the slashes:
$mail = new PHPMailer\PHPMailer\PHPMailer();
This is the same as saying:
use PHPMailer\PHPMailer\PHPMailer;
...
$mail = new PHPMailer();
Later in your code, you're doing this (without having an earlier use statement):
$mail = new PHPMailer;
This won't work unless you either declare the PHPMailer namespace, or import the namespaced class name into your own namespace. Regardless – this is a duplicate and you can simply delete this line.
You might want to read the upgrade guide provided with PHPMailer.

Uncaught TypeError: Cannot read property 'checked' of null from chrome.storage.get()

When I try to load my Google Chrome extension into the browser, I get the above error for my options.js file:
Here are my options.js:
var email_addr = document.getElementById("email_addr");
var email_password = document.getElementById("email_password");
var registerButton = document.getElementById("register");
var url = document.getElementById("url");
var port = document.getElementById("port");
var password = document.getElementById("password");
var ecs_mode = document.getElementById("ecs_mode");
var encrypt = document.getElementById("encrypt");
var include_content = document.getElementById("include_content");
var saveButton = document.getElementById("save");
debugger;
restore_settings();
chrome.storage.sync.get({"emailAddr": email_addr.value,
"emailPassword": email_password.value,
"contentServerURL": url.value,
"contentServerPort": port.value,
"contentServerPassword": password.value,
"ecs_mode": ecs_mode.checked,
"encrypt": encrypt.checked,
"include_content": include_content.checked},
function() {
// Update status to let user know settings were saved.
var status = document.getElementById("status");
status.innerHTML = "Settings Saved.";
setTimeout(function() {
status.innerHTML = "";
}, 750);
});
function register_addr() {
}
// Saves settings to chrome.storage.
function save_settings() {
if (!password.value) return;
chrome.storage.sync.set({"emailAddr": email_addr.value,
"emailPassword": email_password.value,
"contentServerURL": url.value,
"contentServerPort": port.value,
"contentServerPassword": password.value,
"ecs_mode": ecs_mode.checked,
"encrypt": encrypt.checked,
"include_content": include_content.checked},
function() {
// Update status to let user know settings were saved.
var status = document.getElementById("status");
status.innerHTML = "Settings Saved.";
setTimeout(function() {
status.innerHTML = "";
}, 750);
});
}
// Restores select box state to saved value from localStorage.
function restore_settings() {
chrome.storage.sync.get("emailAddr", function(val) {
email_addr.value = val.emailAddr;
});
chrome.storage.sync.get("emailPassword", function(val) {
email_password.value = val.emailPassword;
});
chrome.storage.sync.get("contentServerPassword", function(val) {
password.value = val.contentServerPassword;
});
chrome.storage.sync.get("contentServerURL", function(val) {
url.value = val.contentServerURL;
});
chrome.storage.sync.get("contentServerPort", function(val) {
port.value = val.contentServerPort;
});
chrome.storage.sync.get("ecs_mode", function(val) {
ecs_mode.checked = val.ecs_mode;
});
chrome.storage.sync.get("encrypt", function(val) {
encrypt.checked = val.encrypt;
});
chrome.storage.sync.get("include_content", function(val) {
include_content.checked = val.include_content;
});
registerButton.disabled = false;
saveButton.disabled = false;
}
function ecs_mode_fn() {
if (ecs_mode.checked) {
encrypt.disabled = false;
include_content.disabled = false;
}
else {
encrypt.disabled = true;
include_content.disabled = true;
}
}
function toggleButton() {
if (email_addr.value.length == 0) {
registerButton.disabled = true;
saveButton.disabled = true;
}
else {
registerButton.disabled = false;
saveButton.disabled = false;
}
}
document.addEventListener('DOMContentReady', restore_settings);
if (document.querySelector('#save, #ecs_mode, #save, #restore, #register') != null) {
document.querySelector('#ecs_mode').addEventListener('click', ecs_mode_fn);
document.querySelector('#save').addEventListener('click', save_settings);
document.querySelector('#restore').addEventListener('click', restore_settings);
document.querySelector('#email_addr').addEventListener('keyup', toggleButton);
document.querySelector('#register').addEventListener('click', register_addr);
}
options.html:
<html>
<head><title>ECS Extension Settings</title>
<style type="text/css">
body {
width: 800px;
height: 200px;
}
</style>
</head>
<body>
<center><h1>ECS Content Server Settings</h1></center>
<div title="Enter your e-mail address and password here. The address can be a regular Gmail address ('<someone>#gmail.com') or an e-mail address associated with a Google business account.">
<b>Your e-mail address:</b>
<input type="text" id="email_addr">
<b>Password:</b>
<input type="password" id="email_password">
<button id="register" disabled>Register</button>
</div>
<br>
After entering your e-mail address and password, press the <b>Register</b> button to register your address with the ChiaraMail content server. You will then be sent a registration confirmation e-mail containing a link. Select the link to show your content server password and enter the password in the <b>Content server password</b> field below.
<p>
<div title="The name and port number of the content server are fixed. Enter the password you were assigned during registration. You may change your password later at https://www.chiaramail.com/login.jsp">
<b>Content server URL:</b>
<input type="text" id="url" value="www.chiaramail.com" disabled>
<b>Content server port:</b>
<input type="text" id="port" value="443" size="4" disabled>
<b>Content server password:</b>
<input type="password" id="password" maxlength="8" size="8">
<p>
</div>
<div title="Check the 'Send as ECS' box if you want to send e-mail by default using the ECS technology. You will have the option of changing this setting when you compose your message.">
<b>Send as ECS: </b>
<input type="checkbox" id="ecs_mode" checked>
</div>
<div title="Check the 'Encrypt message' box if you want the message to be stored encrypted on the content server. You will have the option of changing this setting when you compose your message.">
<b>Encrypt message: </b>
<input type="checkbox" id="encrypt">
</div>
<div title="Check the 'Include content' box if you want the message content to be sent along with the mail headers (useful when sending to mixed recipients, some enabled for ECS and others who are not). You will have the option of changing this setting when you compose your message.">
<b>Include content: </b>
<input type="checkbox" id="include_content" checked>
</div>
<!--<div title="Select the 'Show ECS users' box to display message senders in magenta if the sender's e-mail address is registered with the ChiaraMail content server. This enables you to know which of your recipients are able to read ECS messages, but setting this option may adversely affect performance.">
<p>
<b>Show ECS users:</b>
<input type="checkbox" id="ecsusers" checked>-->
</div>
<br>
<div id="status"></div>
<div title="Press 'Save settings' to save your settings and 'Restore settings' to display them. Changes made to your account are propagated to all your devices and systems.">
<button id="save" disabled>Save settings</button>
<button id="restore">Restore settings</button>
</div>
<script src="options.js"></script>
</body>
</html>
and manifest.json:
"name": "Envelope-Content Splitting (ECS) Support for Gmail",
"version": "1.0",
"manifest_version": 2,
"description": "Add ECS support for Gmail running in Chrome. This enables Gmail users who access their accounts via the Google Chrome browser to send and read ECS mail. Check out http://www.chiaramail.com for information about ECS and for links to other FREE ECS-enabled mail clients and extensions.",
"browser_action": {
"default_icon": {"19": "ecs_icon_19.png", "38": "ecs_icon_38.png"},
"default_title": "Press here to configure ECS settings",
"default_popup": "options.html"
},
"options_page": "options.html",
"icons": { "16": "ecs_icon_16.png", "48": "ecs_icon_48.png", "128": "ecs_icon_128.png"},
"background": {
"scripts": ["background.js"]
},
"content_scripts": [
{
"run_at": "document_idle",
"matches": ["https://mail.google.com/mail/*"],
"js": ["updateContent.js", "colorHeaders.js", "renderContent.js", "sendOptions.js", "base64.js", "jsaes.js"]
}
],
"permissions": ["tabs",
"activeTab",
"storage",
"https://mail.google.com/mail/*"],
"content_security_policy": "script-src 'self' https://www.chiaramail.com; object-src 'self'"
}
I suspect the problem is with the way I coded chrome.storage.get(), but I couldn't find the API reference, only an example of how to call it. I'm pretty sure I coded the call to chrome.storage.get() correctly, though. What am I missing?
It turns out that I needed to clear the errors after correcting a missing UI element. I don't understand why Google requires users to clear the errors before reloading the extension; the reload should clear them.

change font size for phpmailer subject

The following function works but I am unable to control the font-size of the "Subject". Is there a way to change the font size of the "Subject". I've tried:
$mail->Subject = "<span style='font-size:3vw'>" .$mailInputs['subject'] ."<\span>";
but that didn't work.
function mailerExpressBlueHost(array $mailInputs){
require_once '../includes/phpmailer/PHPMailerAutoload.php';
$mail = new PHPMailer();
$mail->IsMail();
$mail->SetFrom('example#xyz.com');
$mail->IsHTML(true);
$mail->addAddress('abc#example.com');
$mail->AddEmbeddedImage("../public/img/swb.jpg", "swb-image");
$body = '<!DOCTYPE html>
<html><header>
</header>
<body lang=EN-US>
<div style="text-align:center">
<img src="cid:swb-image">' . $mailInputs['body'] ;
$mail->isHTML(true);
$mail->Subject = $mailInputs['subject'] ;
$mail->Body = $body;
if(!$mail->send()) {
return 'Message could not be sent.' . 'Mailer Error: ' . $mail->ErrorInfo;
} else {
return 'Message has been sent';
}
$mail->ClearAddresses();
}
No, you can't do this. The Subject line does not support HTML formatting; it's plain text only - not least because the definition of the Subject email header predates HTML by at least 10 years.
On the upside, you can use unicode, which allows you quite a lot of tricks, but it's highly dependent on the OS and application it's viewed in.

PasswordReset is not working in WebMatrix

I am using the exsisting PasswordReset form in WebMatrix. I didn't change anything in the module but, it's not working. When I click the "Did you forget your password?" link and it takes me to the ForgotPassword form. After I enter my email address and click 'Send Instructions' it goes to my email. But, when I click on the link it provides I immediately get the Password Reset screen but, he top of the screen says, "Could not reset password. Please correct the errors and try again." Eventhough, I try resetting my password anyway nothing happens.
Below is the Password Reset code:
#* Remove this section if you are using bundling *#
#section Scripts {
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
}
#{
Layout = "~/_SiteLayout.cshtml";
Page.Title = "Password Reset";
var passwordResetToken = Request.Form["resetToken"] ?? Request.QueryString["resetToken"];
bool tokenExpired = false;
bool isSuccess = false;
// Setup validation
Validation.RequireField("newPassword", "The new password field is required.");
Validation.Add("confirmPassword",
Validator.EqualsTo("newPassword", "The new password and confirmation password do not match."));
Validation.RequireField("passwordResetToken", "The password reset token field is required.");
Validation.Add("newPassword",
Validator.StringLength(
maxLength: Int32.MaxValue,
minLength: 6,
errorMessage: "New password must be at least 6 characters"));
if (IsPost && Validation.IsValid()) {
AntiForgery.Validate();
var newPassword = Request["newPassword"];
var confirmPassword = Request["confirmPassword"];
if (WebSecurity.ResetPassword(passwordResetToken, newPassword)) {
isSuccess = true;
} else {
ModelState.AddError("passwordResetToken", "The password reset token is invalid.");
tokenExpired = true;
}
}
}
<hgroup class="title">
<h1>#Page.Title.</h1>
<h2>Use the form below to reset your password.</h2>
</hgroup>
#if (!WebMail.SmtpServer.IsEmpty()) {
if (!Validation.IsValid()) {
<p class="validation-summary-errors">
#if (tokenExpired) {
<text>The password reset token is incorrect or may be expired. Visit the forgot password page
to generate a new one.</text>
} else {
<text>Could not reset password. Please correct the errors and try again.</text>
}
</p>
}
if (isSuccess) {
<p class="message-success">
Password changed! Click here to log in.
</p>
}
<form method="post">
#AntiForgery.GetHtml()
<fieldset>
<legend>Password Change Form</legend>
<ol>
<li class="new-password">
<label for="newPassword" #if (!ModelState.IsValidField("newPassword")) {<text>class="error-label"</text>}>New password</label>
<input type="password" id="newPassword" name="newPassword" disabled="#isSuccess" #Validation.For("newPassword") />
#Html.ValidationMessage("newPassword")
</li>
<li class="confirm-password">
<label for="confirmPassword" #if (!ModelState.IsValidField("confirmPassword")) {<text>class="error-label"</text>}>Confirm password</label>
<input type="password" id="confirmPassword" name="confirmPassword" disabled="#isSuccess" #Validation.For("confirmPassword") />
#Html.ValidationMessage("confirmPassword")
</li>
<li class="reset-token">
<label for="resetToken" #if (!ModelState.IsValidField("resetToken")) {<text>class="error-label"</text>}>Password reset token</label>
<input type="text" id="resetToken" name="resetToken" value="#passwordResetToken" disabled="#isSuccess" #Validation.For("resetToken") />
#Html.ValidationMessage("resetToken")
</li>
</ol>
<input type="submit" value="Reset password" disabled="#isSuccess"/>
</fieldset>
</form>
} else {
<p class="message-info">
Password recovery is disabled for this website because the SMTP server is
not configured correctly. Please contact the owner of this site to reset
your password.
</p>
}
Here is the code in my _AppStart:
WebSecurity.InitializeDatabaseConnection("StarterSite", "UserProfile", "UserId", "Email", autoCreateTables: true);
OAuthWebSecurity.RegisterGoogleClient();
WebMail.SmtpServer = "smtp.gmail.com";
WebMail.EnableSsl = true;
WebMail.SmtpPort = 587;
WebMail.UserName = "mark.anthnony#yahoo.com";
WebMail.Password = "September";
WebMail.From = "mark.anthony#yahoo.com";
Change constancies in your User object. Delete required attributes from there. Also. I suggest to write your own base authentication.

Resources