Ir para conteúdo
Fórum Script Brasil
  • 0

E-mails Em Asp .net Webmatrix


Guest Filipe - WebMaster

Pergunta

Guest Filipe - WebMaster

Gostaria de enviar e-mails pelo webmatrix mas não dá certo .....

Já li trocentos arigos inclusive os do macoratti e da msdn, mas não func .....

alguém pode me dizer se não func por causa do webmatrix ou eu estou fazendo errado ?

Quiserem ir pelo MSN ...... filipefws@hotmail.com huh.gif

Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0

<%@ Page Language="VB" %>

<%@ import Namespace="System.Web.Mail" %>

<script runat="server">

Sub btnEnviar_Click(sender As Object, e As EventArgs)

Dim strPara As String

Dim strDe As String

Dim strtexto As String

strPara = "filipefws@hotmail.com"

strDe = "webmaster@professorando.com"

strTexto = "Olá, system"

'strAssunto="Contato do Site para Ricardo Automóveis"

SmtpMail.Send(strDe, strPara, strTexto,"Teste")

response.redirect("ContatoII.aspx")

End Sub

</script>

<html>

o erro .....

Server Error in '/' Application.

--------------------------------------------------------------------------------

The transport failed to connect to the server.

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: The

transport failed to connect to the server.

Source Error:

Line 29: SmtpMail.SmtpServer ="smtp2.seuservidor.com.br"

Line 30:

Line 31: SmtpMail.Send(objEmail) <<<<<<<<<< em vermelho !!!

Line 32:

Line 33:

Source File:

d:\DZHosts\LocalUser\filipefws\professorando.somee.com\ricautos\contato.aspx

Line: 31

Stack Trace:

[COMException (0x80040213): The transport failed to connect to the server.

]

[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) +113

System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1844

System.Web.Mail.SmtpMail.Send(MailMessage message) +153

ASP.Contato_aspx.btnEnviar_Click(Object sender, EventArgs e) in

d:\DZHosts\LocalUser\filipefws\professorando.somee.com\ricautos\contato.aspx:31

System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(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() +1262

--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET

Version:1.1.4322.2300

obrigado !

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      651,9k
×
×
  • Criar Novo...