c# - Transaction failed. The server response was: 5.7.1 Forged HELO -


transaction failed. server response was: 5.7.1 forged helo .

description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code.

exception details: system.net.mail.smtpexception: transaction failed. server response was: 5.7.1 forged helo .

    session["new"] = textbox1.text;     mailmessage msg;     string activationurl = string.empty;     string emailid = string.empty;                                     msg = new mailmessage();     smtpclient smtp = new smtpclient();     emailid = textbox1.text.trim();     msg.from = new mailaddress("******");     msg.to.add(emailid);     msg.subject = "confirmation e-mail";     msg.body = str2;     msg.isbodyhtml = true;     smtp.credentials = new networkcredential("*********", "**********");     smtp.port = 25;     smtp.host = "***********";     smtp.enablessl = false;                                     smtp.send(msg);     scriptmanager.registerstartupscript(this, this.gettype(), "message", "alert('confirmation link activate account has been sent email address');", true);                                                                     response.redirect("successfull.aspx"); 

my web.config file

<configuration>         <connectionstrings>       <add name="connectionstring" connectionstring="server=***.**.***.**;database=***********;integrated security=false;uid=**********;pwd=**********;" providername="system.data.sqlclient" />       <remove name="localsqlserver"/>       <add name="localsqlserver" connectionstring="server=***.**.***.**;database=************;user id=*****************;password=*****************;" />       </connectionstrings>     <system.web>         <compilation debug="true" targetframework="4.0" />      </system.web>   <system.web>   <machinekey validationkey="**************************************" decryptionkey="****************************************************" validation="****" decryption="***" />   </system.web>     <system.web>     <customerrors mode="off" />   </system.web> </configuration> 

i got same error , able fix issue changing mail settings in code. actually, using different email-id in:


msg.from = new mailaddress("******");    smtp.credentials = new networkcredential("*********", "**********"); 

so,i used same email-id in smtp authentication , address.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -