Unable to send mail with SMTP

Discussion in 'Email' started by sewposhms, Feb 3, 2011.

  1. I haven't been able to find anything in Winhost about what port to use for sending email through SMTP, so I think that's the issue I'm having, but here's my code just in case it's something else:

    Code:
    private void SendMessage(string subject, string message, string toEmail)
            {
                MailMessage mm = new MailMessage("email@sewposh.com", toEmail);
    
                mm.Subject = subject;
                mm.Body = message;
    
                SmtpClient sc = new SmtpClient("mail.sewposh.com", 587);
    
                // our account credentials
                sc.Credentials = new NetworkCredential("email@sewposh.com", "emailpassword", "");
                sc.EnableSsl = true;
    
                // Catching result
                try
                {
                    sc.Send(mm);
                }
                catch (Exception ex)
                {
    
                }
            }
    I've tried this over and over, and it never sends the email. I know I've got the right email address and password, because I've double checked that I could log in with it, but the error I read in Fiddler sounds like an authentication error:
    Code:
    HTTP/1.0 200 Authentication required
    Connection: keep-alive
    X-Bst-Request-Id: cfPrgh:m6j:297895
    X-Bst-Info: t=1296783223,h=11g,p=2_517,f=ForceAuthFilter,r=ForceAuthRule,c=2394
    Content-Type: text/html; charset=utf-8
    Pragma: No-cache
    Cache-Control: No-cache
    Content-Length: 2071
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
    <html>
      <head>
        <link rel="stylesheet" href="http://www.mailcontrol.com/css/proxy.css" type="text/css">
        <link rel="shortcut icon" href="http://www.mailcontrol.com/images/wd_accessdenied.ico" type="image/x-icon">
        <title>Authentication Required</title>
      </head>
      <body>
        <div align="center">
        <div id="pagecontainer"><img src="http://www.mailcontrol.com/images/block.png" class="icon" >
        <h1>You are connecting from an unrecognized location.</h1>
        <div align="center">
        To access the Web, you must identify yourself.<br/>
        Please login with the email address and password you used to register with the hosted service.
        <table>
          <tr>
    	<td align="top"><form method='POST' ACTION='http://proxy-login.blackspider.com/'>
      <input type='hidden' name='meth' value='POST'/>
      <input type='hidden' name='url' value='http%3A//sewposhc.w01.Winhost.com/SPService.svc'/>
      <input id='proxy_login_button' type='submit' value='Log in...'/>
      <script>document.getElementById('proxy_login_button').focus();</script>
    </form></td>
    	<td align="top"><form method='POST' ACTION='https://www.mailcontrol.com/enduser/reg/index.mhtml'>
      <input type='hidden' name='site' value=''/>
      <input type='hidden' name='ntlmid' value=''/>
      <input type='hidden' name='meth' value='POST'/>
      <input type='hidden' name='url' value='http://sewposhc.w01.Winhost.com/SPService.svc'/>
      <input type='submit' value='Register...'/>
    </form></td>
    	<td align="top"><form method='POST' ACTION='https://www.mailcontrol.com/enduser/forgot/index.mhtml'>
      <input type='hidden' name='site' value=''/>
      <input type='hidden' name='ntlmid' value=''/>
      <input type='hidden' name='meth' value='POST'/>
      <input type='hidden' name='url' value='http://sewposhc.w01.Winhost.com/SPService.svc'/>
      <input type='submit' value='Forgotten password?'/>
    </form></td>
          </tr>
        </table>
        <p>Please refer to your organization's Internet access policy.</p>
        </div>
        </div>
        </div>
      </body>
    </html>
     
    Last edited by a moderator: Oct 14, 2015
  2. Ray

    Ray

    Make sure that the email login you are using email@sewposh.com actually exist and that the password you are using with it is correct. Bear in mind when you connect to mail.sewposh.com, our SMTP server will try to authenticate you first.
     
  3. I have verified the email and password. I can use it to get in either through smartermail manager or through my iPhone with the same email and password.

    I tried changing the port to 110. That's the port I used on the iPhone, and it works. Unfortunately it didn't work. It did give me a different error in Fiddler. Here's the new error:

    Code:
    POST http://sewposhc.w01.Winhost.com/SPService.svc HTTP/1.1
    Accept: */*
    Content-Length: 532
    Content-Type: application/soap+msbin1
    Accept-Encoding: gzip, deflate
    User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; FunWebProducts; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Tablet PC 2.0)
    Host: sewposhc.w01.Winhost.com
    Proxy-Connection: Keep-Alive
    Pragma: no-cache
    Cookie: __utma=119716366.1908115882.1291353020.1296781275.1296859535.18; __utmz=119716366.1291353020.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmb=119716366.1.10.1296859535; ASP.NET_SessionId=4hsbg045b2biis45mtp1ox45; __utmc=119716366
    
    V
    s
    aVD
    ���urn:SPService/RegisterD����L֥M�bC�	M��D,D*�D���-http://sewposhc.w01.Winhost.com/SPService.svcV@Register@siteId�@user	b6http://schemas.datacontract.org/2004/07/SewPoshManager	i)http://www.w3.org/2001/XMLSchema-instance_Address1_Address2_Admin�_City_	Confirmed�_Email�matthew.swain@mvtransit.com_Id�_Name_Password�that1guy_Phone_
    ReceiveEmails�_SiteIds.nil�	c9http://schemas.microsoft.com/2003/10/Serialization/Arrays_State_Zip@url�'http://sewposh.com:80/ConfirmEmail.aspx
     
    Last edited by a moderator: Oct 14, 2015
  4. Ray

    Ray

    I'm pulling up mail.sewposh.com on my browser and I tried to log in using email@sewposh.com and I am getting user does not exist error.
     
  5. I changed it for the post because I didn't want to reveal any usernames and passwords on a public forum. It's not really email@sewposh.com. If you email me I'll give you the actual information.
     
  6. Ray

    Ray

    I don't think that you are passing the SMTP authentication correctly. All the symptoms seem to point to that. Try this. Create a simple web application that will send out the email.

    http://support.Winhost.com/KB/a650/how-to-send-email-in-aspnet.aspx

    Make sure you hard code everything and don't pass any of the email addresses in a variable.
     
    Last edited by a moderator: Oct 14, 2015
  7. I did that, and it worked. I was able to send email to myself, but when I tried to send an email to my gmail account it didn't work.
     
  8. I've also started having problems checking email with my iPhone. When I thought I had it set up it turned out that I couldn't send emails with it, and after a few days it stopped checking email as well.
     
  9. Ray

    Ray

    Are you able to use another source to send out email such as Outlook or some other email client like ThunderBird using mail.sewposh.com?

    What is the error you are getting on your contact form on your web page when you try to send email to gmail? Do you also get the same error when you send to any other outside email addresses other then @sewposh.com?
     
  10. Yes, I can send and receive emails in Thunderbird for my @sewposh.com account. Maybe I've got a port wrong on my iPhone. I'll try changing them to match Thunderbird. Someone else has the phone now, so I'll try later.

    I also figured out why it didn't send my gmail a message. I had a typo. When I copied that code into my main function for sending email messages it started working as well.

    Thank you very much.
     

Share This Page