Problemas com email na minha máquina
Galera bom dia,
Estou com um grande problema que é exatamente testar o codigo de envio de email na minha máquina, tenho o código abaixo:
::::::::::::::::::::codigo::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<%@ Import namespace="System.Web.Mail"%>
<html>
<head>
<title>LRC Construtora - LTDA.</title>
<link href="css/texto.css" rel="stylesheet" type="text/css">
<script runat="server">
Sub Enviaemail(obj as object, e as eventargs)
Dim mensagem as String ' Aqui estou criando um novo objeto
Dim email as String
mensagem +="Contato para construtora LRC<br>"
mensagem +="Nome do contato:"+nome.text
Dim objEmail as New MailMessage
email = "Construtora LRC LTDA. (guilherme.carneiro@uol.com.br)"
with objEmail
.To=email
'.BCC="macoratti@yahoo.com"
.FROM="macoratti@pop.com.br"
.SUBJECT="Contato."
.BODY=mensagem
.BodyFormat = MailFormat.HTML
'.SmtpServer = smtp.localweb.com.br
end with
SmtpMail.Send(objEmail)
'Err.Raise(Err.Number, Err.Source, ex.Message)
response.Redirect("www.uol.com.br")
end sub
</script>
........
<form runat="server" action="enviando.aspx">
<table width="90%" border="0" cellspacing="0">
<tr align="left">
<td width="22%">Nome:</td>
<td width="78%"><asp:TextBox runat="server" ID="nome"></asp:TextBox></td>
</tr>
<tr align="left">
<td>Telefone:</td>
<td><asp:TextBox runat="server"
ID="telefone"></asp:TextBox></td>
</tr>
<tr align="left">
<td>Assunto</td>
<td><asp:TextBox runat="server"
ID="assunto"></asp:TextBox></td>
</tr>
<tr align="left">
<td valign="top">Mensagem</td>
<td><asp:TextBox runat="server" ID="mensagem"
Width="15" Height="25" TextMode="MultiLine"></asp:TextBox></td>
</tr>
<tr align="left">
<td valign="top" class="style2"><asp:Button
runat="server" ID="Enviando" Text="Enviar"
OnClick="Enviaemail"></asp:Button></td>
<td> </td>
</tr>
</table>
</form>
Quando eu mando para o servidor funciona normalmente, quando eu tento rodar aqui na minha máquina dá erro:
Server Error in '/lrc' Application.
O valor de configuração "SendUsing" é inválido.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: O
valor de configuração "SendUsing" é inválido.
Source Error:
The source code that generated this unhandled exception can only be
shown when compiled in debug mode. To enable this, please follow one
of the below steps, then request the URL:
1. Add a "Debug=true" directive at the top of the file that generated
the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
Note that this second technique will cause all files within a given
application to be compiled in debug mode. The first technique will
cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a
memory/performance overhead. You should make sure that an application
has debugging disabled before deploying into production scenario.
Stack Trace:
[COMException (0x80040220): O valor de configuração "SendUsing" é inválido.
]
[TargetInvocationException: Exception has been thrown by the target of
an invocation.]
System.RuntimeType.InvokeDispMethod(String name, BindingFlags
invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers,
Int32 culture, String[] namedParameters) +0
System.RuntimeType.InvokeMember(String name, BindingFlags
invokeAttr, Binder binder, Object target, Object[] args,
ParameterModifier[] modifiers, CultureInfo culture, String[]
namedParameters) +473
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
methodName, Object[] args) +58
[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
methodName, Object[] args) +112
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1840
System.Web.Mail.SmtpMail.Send(MailMessage message) +153
ASP.contato_aspx.Enviaemail(Object obj, EventArgs e) +136
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBa
ckEvent(String
eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277
Version Information: Microsoft .NET Framework Version:1.1.4322.573;
ASP.NET Version:1.1.4322.573
:::::::::::::::fim do
erro:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Ai eu entrei num site e verifiquei que ele manda colocar o parametro
SmtpMail.SmtpServer="localhost"
eu já fiz isto mas continua não mandando, então eu habilitei o serviço de smtp, e agora o erro que estou tendo é o seguinte.
Server Error in '/' Application.
O servidor rejeitou um ou mais endereços de destinatário. A resposta do servidor foi: 550 5.7.1 Unable to relay for vendas@toyotapb.com.br
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: O servidor rejeitou um ou mais endereços de destinatário. A resposta do servidor foi: 550 5.7.1 Unable to relay for vendas@toyotapb.com.br
O que seria agora?
Discussão (9)
Carregando comentários...