Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8151107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:16:13+00:00 2026-06-06T15:16:13+00:00

As the title says, I am sending email from my ASP.net web application without

  • 0

As the title says, I am sending email from my ASP.net web application without any attachment (for now) but strangely the body of email is going as a separate HTML file attached to blank email like when I click the HTML file it opens the body in separate window with everything that I have written in body as standalone HTML file, this is only happening when I send email to some portals like e-lance but when I send it to gmail or hotmail address then email is going perfectly with no attachment and body-text appearing where it should.

My email code is

    public bool sendMail(string messageSubject, System.Net.Mail.MailAddress fromEmailAddress, System.Net.Mail.MailAddress toEmailAddress, string source_id, string messageText)
    {
        System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
        mail.IsBodyHtml = true;
        mail.Subject = messageSubject;
        mail.From = fromEmailAddress;
        mail.To.Add(toEmailAddress);
        mail.Body = messageText;

        SmtpClient relayServer = new SmtpClient();

        List<KeyValuePair<string, string>> commandParameters = new List<KeyValuePair<string,string>>();
        commandParameters.Add(new KeyValuePair<string,string>("@source_id", source_id));
        DataTable sourcesTable = SQLSelect("SELECT * FROM LogiCrmSources WHERE source_id = @source_id", commandParameters);

        relayServer.Host = sourcesTable.Rows[0]["source_smtp"].ToString();
        relayServer.Port = Convert.ToInt16(sourcesTable.Rows[0]["source_smtp_port"].ToString());
        if (relayServer.Port == 25)
        {
            relayServer.EnableSsl = false;
        }
        else
        {
            relayServer.EnableSsl = true;
        }
        relayServer.Credentials = new System.Net.NetworkCredential(sourcesTable.Rows[0]["source_email"].ToString(), sourcesTable.Rows[0]["source_password"].ToString());
        try
        {
            relayServer.Send(mail);                
            return true;
        }
        catch(SmtpFailedRecipientException exp)
        {
            return false;
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T15:16:14+00:00Added an answer on June 6, 2026 at 3:16 pm

    Not all clients can handle html emails properly. Gmail for example can while the portals you mention can’t. In those cases the body of the email as sent as an attachment.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The title says everything :) I'm developing a web application and would love to
Like the title says. I'm sending a simple cUrl cmd from Win7 to CouchDB
Exactly what the title says...........any thoughts on other good options for relational database implementation
As title says, I'm wondering if stacking subviews can slow down an iPhone application.
As title says, is there any way to pull something like this up?: std::set<boost::shared_ptr<MyClass>>
As title says, is there any elegant and safe way to determine if architecture
Well title says all I guess. I've tried to print_r($_SERVER) but my 'post-request' I
As the title says i want to call a mixed mode assembly from unmanaged
Like the title says, how can i remove the spinwheel from a Panel? I
Title says it pretty much all... I'm trying to automate tests on a web

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.