Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

filipefws

e-mails .... não consigo enviar .....

Recommended Posts

Server Error in '/' Application.--------------------------------------------------------------------------------The "SendUsing" configuration value is invalid. 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 "SendUsing" configuration value is invalid. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [COMException (0x80040220): The "SendUsing" configuration value is invalid.][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) +111 System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1844 System.Web.Mail.SmtpMail.Send(MailMessage message) +153 FotoMais.Index.btnEnviar_Click(Object sender, EventArgs e) in D:\Filipe\Visual Studio 2k3 WebSites\FotoMais\Index.aspx.vb:64 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() +1292 --------------------------------------------------------------------------------Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300

Compartilhar este post


Link para o post
Compartilhar em outros sites

codigo c# funcionando bonitinho aproveite ^^private void bt_enviar_Click(object sender, System.EventArgs e) { //declarar um objecto do tipo mailmessage MailMessage zNewEmail = new MailMessage(); //declara o anexo MailAttachment mAnexo = new MailAttachment(File1.PostedFile.FileName); IList msgAttachments = zNewEmail.Attachments; msgAttachments.Add(mAnexo); //final do anexo //valores para a permisao de envio de email para o servidor string smtpServer = "smtp.servidor.com.br"; string userName = "email@provedor.com.br"; string password = "senha"; int cdoBasic = 1; int cdoSendUsingPort = 2; //AUTENTICACAO NO SERVIDOR DE EMAIL if (userName.Length > 0) { zNewEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", smtpServer); zNewEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25) ; zNewEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", cdoSendUsingPort) ; zNewEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", cdoBasic); zNewEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", userName); zNewEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", password); } zNewEmail.To = txt_destino.Text; //Criando a Variavel que vai receber o Email do Remetente\\ zNewEmail.From = "paulo@datasig.com.br"; //Criando a Variavel que vai receber o Titulo\\ zNewEmail.Subject = txt_titulo.Text; //Criando a Variavel que vai receber o Corpo\\ zNewEmail.Body = fck_default.Value; //Criando a Variavel que vai receber o CC\\ zNewEmail.Cc = txt_cc.Text; //Criando a Variavel que vai receber o BBC\\ zNewEmail.Bcc = txt_bcc.Text; //Tipo de Email MailFormat.Text = texto, MailFormat.html = html\\ zNewEmail.BodyFormat = MailFormat.Html; //nao sei para o que serve\\ zNewEmail.Priority = MailPriority.Normal; //Servidor para envio de Email\\ SmtpMail.SmtpServer = "smtp.datasig.com.br"; //envia o email\\ SmtpMail.Send(zNewEmail); lb_menssagem.Text = "Email Enviado com Sucesso"; } }

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.