Error myMail.Send object

Discussion in 'Site Programming, Development and Design' started by 0009540, Jan 4, 2011.

  1. HI, Guys.
    I am trying to use this code below on my Winhost website (This code working fine on Windows 2003 & IIS server).
    I am getting the error at last when the code reach to line “myMail.Send”
    I think the error comes as result of bad path or maybe I do have permission mismatch.

    "CDO.Message.1 error '80040222'
    The pickup directory path is required and was not specified. "





    I will appreciate your getting help.
    Thanks in advance…


    *****************************************
    <%@language=vbscript CodePage=1255%>
    <%
    '---Send the request by mail-----------
    Set myMail = CreateObject("CDO.Message")

    myMail.Subject = "WEB - contact us"
    myMail.From = "[email protected]"
    myMail.To = " [email protected] "
    myMail.BodyPart.Charset = "windows-1255"
    myMail.HTMLBody = "test 123"

    myMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
    myMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
    myMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
    myMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "XXX"
    myMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mvucgukv"
    myMail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/languagecode") = 1255

    myMail.Configuration.Fields.Update
    myMail.Send

    Set myMail = nothing
    '--------------------------------------

    Response.Write "OK"
    %>

    ***************************************************************
     
  2. Ray

    Ray

    We do no have pickup directory enabled on the server nor do we have the servers SMTP service enabled. You will need to use the email account we provided for you on your Winhost service to relay out email, and furthermore, our email server requires that you pass SMTP authentication.

    Try looking at this kb article for an example on how to code CDO to send out email from our email servers.

    http://support.Winhost.com/KB/a617/how-to-send-mail-using-cdo.aspx

    If you are not using our email servers and you have some other 3rd party email server you want to use that is not of Winhost you are allowed to do so. However, it will be up to you to find out what the SMTP server name will be and whether or not they require SMTP authentication.
     
    Last edited by a moderator: Oct 14, 2015
  3. Thanks Ray, your answer is just what I needed, and it is working well.
    The only open issue I do have now, is regarding localize language, I used bellow example but I am getting error with the new code now, this line is needed in effort to be able to read localize language and avoiding “Gibberish” like this “??????”

    • I used this line before…
    Fids.Item ("http://schemas.microsoft.com/cdo/configuration/languagecode") = Session.Contents("CodePage")

    Thanks
    Nir
     
  4. Ray

    Ray

    When you state "localize language" I assume you mean displaying foreign fonts. First and fore most the server really has nothing to do with how fonts are displayed. The 3 key factors is the clients browser, the web application and how you have the character set coded, and the database.
    As for the clients browser, well I'm afraid we really can't do much about that. If they don't have the proper fonts installed on their computer to view your site, then it will not display correctly no matter what we do, but luckily most browsers typically carry a large array of fonts so the sites can be viewed normally.

    The other 2 we have full control over. I'm not sure what font you are going to use so I suggest you take a look at the Internet and search around for the correct character set that will best display your site.

    http://en.wikipedia.org/wiki/Character_encoding

    Next is your database if you are planning to store data with foreign fonts within your database. The key thing to focus on is collation and the data type you will be storing the data. When you create a table you get to define the columns and it ask you for the data type. Try using nvarchar since that seems to work the best. The collation just like the character set will have to be determined by you.
     

Share This Page