Problem With CDO in sending formatted text mail

Discussion in 'ASP General' started by k.visube, Jun 14, 2006.

  1. k.visube

    k.visube Guest

    In my ASP application,i need to send a formatted text mail (i.e with
    newline characters).
    here in my application i used a function in javascript which construts
    the mail body
    sample snippet

    strbody=strbody +"dear customer,\n";
    strbody=strbody +"we are glad to see ur response\n";
    strbody=strbody +"we will make the needful thing as early as

    sendmail(strbody) \\ this is a function to send email that written in

    then send mail function uses cdo to send mail.
    inside th sendmail() function . i ve set the mail body as textbody

    objCDO.To = strTo
    objCDO.From = strFrom
    objCDO.Subject = strSubject
    objCDO.TextBody =strBody

    The actual problem is it works fine and produces text line breaks in
    yahoo , hotmail, gmail ids .but with some other ids ...i seems not
    working properly..i doesnt respect the newline character and shows the
    mailbody as a chunk of paragraph...

    why this type of controdictory effect with cdo with some mail ids....
    Give me an idea to get rid off this problem .. thanx in advance

    k.visube, Jun 14, 2006
    1. Advertisements

  2. Have you tried \r\n instead of just \n. I believe strictly speaking \r\n is
    the standard in SMTP emails.
    Anthony Jones, Jun 14, 2006
    1. Advertisements

  3. k.visube

    k.visube Guest

    thanks jones, the solution to above problem now in second position.
    here now major problem is the send mail i send to some email ids not
    reaches its destination , but for the mails to all free mailds like
    yahoo,sify, hotmail, gmail,.....etc works fine and i could get my mail
    at those mailbox.
    i am unable to send mail to some specific ids.. while executing the
    script there is no error message but the message not reaches its
    destination.. i ve tried whole day by refreshing my mail box .
    i am testing my application under windows 2003 iis 6
    there any specific SMTP server config is need?.. if so then how could i
    able to send mail to free mail ids (yahoo, hotmail) alone?. not to some
    specific ids.
    can anyone help in this regard?....
    k.visube, Jun 14, 2006
  4. then that is not an ASP related issue.. it is a mail server/ system admin
    type of issue

    once asp sends the email it has no control over what doesn't make it to the
    sender, gets marked as spam, gets stopped by blacklist filters, etc etc
    Kyle Peterson, Jun 14, 2006
  5. k.visube

    k.visube Guest

    Still the problem pursues.. once again formatting comes in to big
    First i ll tell my server Config
    Win 2003
    IIS 6 +SMTP server installed

    I am using two functions
    one in javascript which constructs the mail body
    and another one in vbscript for sending mail by using CDO.

    in javascript function i m constructing the mail body
    like as follows..

    strBody=strBody+"Dear customer \n";
    strBody=strBody+"We got ur queries and we are working on them\n";
    strBody=strBody+"You will get the response as early as possible \n";

    in the vbscript function

    function sendmail(strBody)
    Set objMessage = CreateObject("CDO.Message")
    objMessage.Subject = Request.Form("subject")
    objMessage.Sender = Request.Form("From")
    objMessage.To = Request.Form("To")
    objMessage.TextBody =strBody
    end function

    The problem is when i receive and read this mail at my official domain
    ids() it looks not line breaked ..instead it looks
    like chunk of paragraph.

    But the surprising thing is the same mail sent to free mail ids is like
    yahoo,hotmail, gmail are works fine.yes it looks line breaked.. why
    this controversial effects is happening?...
    whether my code is wrong or is there any problem with my smtp server
    config (it s configed inside IIS itself. i could see a tree menu named
    with smtp virtual server) . or the mail destination server
    that it represent non line breaked mail. i couldnt predict cause for
    this issue.

    Give me idea to solve this problem. thanks in advance.thanks for
    previous replys too

    k.visube, Jun 16, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.