ok .. thanks @RomanovM, @ sina.islam are not very practical in programming.
In the Meantime I did this send-mail.schtml (From Action= Send-mail.schtml by form conctactus)
******************************
@{
var Name = Request["Name"];
var Azienda = Request["Azienda"];
var Indirizzo = Request["Indirizzo"];
var Cap = Request["Cap"];
var Citta = Request["Citta"];
var Email = Request["Email"];
var Tel = Request["Tel"];
var Richiesta = Request["Richiesta"];
var errorMessage = "";
var debuggingFlag = false;
try
{
// Initialize WebMail helper
WebMail.SmtpServer = "smtp.xxxxxxxit";
WebMail.SmtpPort = 25;
WebMail.UserName = "
[email protected]";
WebMail.Password = "xxxxxxxxxxxx";
WebMail.From = "
[email protected]";
// Send email
WebMail.Send(to: "
[email protected]",
subject: "Richiesta Informazioni da
[email protected] - " + Name ,
body: "<strong>Nome: </strong>" + Name + "<br><strong> Azienda: </strong>" + Azienda + "<br><strong> Indirizzo: </strong>" + Indirizzo + "<br><strong> Cap :</strong>" + Cap + "<br><strong>Città : </strong>" + Citta + "<br><strong> Email: </strong>" + Email+ "<br><strong> Tel: </strong>" + Tel + "<br><strong> Richiesta: </strong>" + Richiesta
,from:"
[email protected]",bcc:"
[email protected]" );
}
catch (Exception ex)
{
errorMessage = ex.Message;
}
}
<!DOCTYPE html>
<html>
<head>
<title>Richiesta Info</title>
</head>
<body>
<p>Gentile <b>@Name</b> </p>
@if (errorMessage == "")
{
<p>
<strong>Email inviata Correttamente</strong>
</p>
<p>Riepilogo :<br /> @Name <br />
@Azienda <br />
@Indirizzo <br />
@Cap <br />
@Tel <br />
<b> @Richiesta</b></p>
}
else {
<p><b>Email <em>non è</em> stata inviata.</b></p>
<p>
problemi sul smtp
</p>
if (debuggingFlag)
{
<p>Errore:</p>
<p><em>@errorMessage</em></p>
}
}
</body>
</html>
************************************************
ERROR:
System.Web.HttpException (0x80004005): 'The path'/Send-mail.cshtml' is not allowed. in System.Web.HttpForbiddenHandler.ProcessRequest(HttpContext context) in System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() in System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
++++++++++++++++++++++++++++++++++++++
Why???