×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    May 2010
    Posts
    152

    How to send html tags in email body?

    Hi,

    I want to send html tags in email body with following specifications :

    MIME-Version: 1.0
    Content-Type: text/html; charset='utf-8'
    Content-Transfer-Encoding: base64


    I am using CImSmtpSettings for smtp settings and I have tried following functions with different parameters , but on the receiving side instead of displaying the formatted output those html tags them self are being displayed(in text format).

    smtpSettings->SetBodyEncoding(EMsgOutboxMIME); //// I tried EMsgOutboxMHTMLAsMIME and EMsgOutboxMHTMLAlternativeAsMIME also as function parameters but it didn't work.

    I am sending and viewing these emails in gmail.

    Kindly help... I have already searched wiki for this and found a few links but didn't get the answer.

    Thanks in Advance.
    Ravi Soni

  2. #2
    Super Contributor
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: How to send html tags in email body?

    HI,

    because the email parsing renderer actually scans for the tags and then displays on the screen. You need to implement your parser if you want to make use of html display itself, or there must be some api , to check if the html parsing can be avoided.
    Most likely api doesnt exist. Need to check that out.

    Regards,
    Mateen Maldar
    "Whatever the mind can conceive and believe, the mind can achieve"

  3. #3
    Regular Contributor
    Join Date
    May 2010
    Posts
    152

    Re: How to send html tags in email body?

    Quote Originally Posted by mateen_maldar View Post
    HI,

    because the email parsing renderer actually scans for the tags and then displays on the screen. You need to implement your parser if you want to make use of html display itself, or there must be some api , to check if the html parsing can be avoided.
    Most likely api doesnt exist. Need to check that out.

    Regards,
    Mateen Maldar
    Hi mateen_maldar

    Thanks a lot for the quick reply.
    Can you plz elaborate a little more about email parsing renderer. Does this email parser renders works on the sender side or the receiver side and what is its basic function and if I make one then how can I use it.

    Thanks again...
    Ravi Soni

  4. #4
    Super Contributor
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: How to send html tags in email body?

    HI,

    S60 5th Edition C++ Developer's Library v2.1 > Symbian Developer's Library v9.4 > Symbian OS v9.4 > Symbian OS guide > Messaging > Using Email > Processing Email Messages in Chunks

    Overview

    In Symbian OS versions earlier than 9.4, POP3 and IMAP email MTMs used the rich text format for storing email messages. These MTMs create the entire email message received from the email servers, and stores and commits into the mail store synchronously.

    From Symbian OS v9.4 onwards, POP3 and IMAP email MTMs can use the plain text format for storing email messages. The entire email message is not created in the RAM. Only chunks of the message are stored in the RAM at a time, as writing or reading is done asynchronously. This decreases RAM usage and increases the performance of downloading and storing email messages.

    The CMsvStore class is modified with the following APIs to enable chunk method:

    *

    CMsvPlainBodyText
    *

    CImPlainBodyText

    Regards,
    Mateen Maldar
    "Whatever the mind can conceive and believe, the mind can achieve"

  5. #5
    Regular Contributor
    Join Date
    May 2010
    Posts
    152

    Re: How to send html tags in email body?

    Hi mateen_maldar,

    I think this is to handle incoming emails, but I need help about outgoing emails (sMTP email.)

    I am sending the email body with html tags, but on the receiving side(gmail) its not being displayed properly.

    Plz gude...

    Thanks...
    Ravi Soni

  6. #6
    Super Contributor
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: How to send html tags in email body?

    hi,

    please check InternetEmail example.

    Regards,
    Mateen Maldar
    "Whatever the mind can conceive and believe, the mind can achieve"

  7. #7
    Regular Contributor
    Join Date
    May 2010
    Posts
    152

    Re: How to send html tags in email body?

    Quote Originally Posted by mateen_maldar View Post
    hi,

    please check InternetEmail example.
    Can you plz provide the link to this example..
    I searched it but didn't get.

    Thanks...
    Ravi Soni

  8. #8
    Super Contributor
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: How to send html tags in email body?

    Hi,

    Check this
    Nokia Symbian ^3 Developer's Library v0.9 > Symbian Guide > Messaging Application Guide > Email > IMAP4 MTM
    in library.forum.nokia.com

    Quote Originally Posted by raviksoni View Post
    Can you plz provide the link to this example..
    I searched it but didn't get.

    Thanks...
    Regards,
    Mateen Maldar
    "Whatever the mind can conceive and believe, the mind can achieve"

  9. #9
    Regular Contributor
    Join Date
    May 2010
    Posts
    152

    Re: How to send html tags in email body?

    I tried that but didn't seem to help much.

    The code which I am using is very straight forward but its not using the encoding which I am mentioning..
    Here is the code :

    CImIAPPreferences* accessPointPrefs;
    accessPointPrefs=SetupConnectionL();

    CImSmtpSettings *smtpSettings = new ( ELeave ) CImSmtpSettings;
    CleanupStack::PushL( smtpSettings );
    smtpSettings->Reset();
    smtpSettings->SetEmailAddressL( KEmailAddress );
    smtpSettings->SetReplyToAddressL( KEmailAddress );
    smtpSettings->SetReceiptAddressL( KEmailAddress );
    smtpSettings->SetLoginNameL( KSmtpLogin );
    smtpSettings->SetPasswordL( KSmtpPass );
    smtpSettings->SetRequestReceipts( EFalse );
    smtpSettings->SetSendCopyToSelf( ESendCopyAsBccRecipient );
    smtpSettings->SetSendMessageOption( ESendMessageImmediately );
    smtpSettings->SetServerAddressL( KServerAddress );
    smtpSettings->SetPort( KSMTPDefaultPortNumber );
    smtpSettings->SetSecureSockets( ETrue );
    smtpSettings->SetSMTPAuth(EFalse);
    smtpSettings->SetBodyEncoding(EMsgOutboxNoAlgorithm); // this function does not seem to work with any parameter...

    RSendAs send;
    User::LeaveIfError(send.Connect());
    CleanupClosePushL(send);
    RSendAsMessage sendAsMessage;
    sendAsMessage.CreateL(send, KUidMsgTypeSMTP);
    CleanupClosePushL(sendAsMessage);
    sendAsMessage.SetSubjectL(_L("Welcome back to symbian"));
    sendAsMessage.AddRecipientL(_L("abc.xyz@gmail.com"),RSendAsMessage::ESendAsRecipientTo);

    TBuf<100> obj;
    sendAsMessage.SetBodyTextL(_L("<html><body>Some more html tags</body></html>"));

    sendAsMessage.SendMessageAndCloseL();
    iRunning = ETrue;
    _LIT(KConnecting,"Connecting...");
    CleanupStack::Pop();
    CleanupStack::Pop();
    CleanupStack::PopAndDestroy();
    Whatever I html tags I give they appear as it is in the email body...
    The email always go as multipart msg(independent of selected encoding) and first part is alway plain text and sencond part is text/html type and base64 encoding...

    Plz anybody help...
    Ravi Soni

Similar Threads

  1. Replies: 0
    Last Post: 2009-12-30, 07:43
  2. Editor and HTML tags
    By mariadlangeles in forum Symbian User Interface
    Replies: 2
    Last Post: 2009-05-07, 09:52
  3. How to get HTML body of the POP3 message (email)
    By jkopera in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2008-11-21, 15:51
  4. HTML Tags
    By mousawi59 in forum Mobile Java General
    Replies: 2
    Last Post: 2008-08-18, 09:28
  5. html tags
    By kmsoomro in forum Mobile Java General
    Replies: 0
    Last Post: 2006-01-05, 12:31

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×