Results 1 to 9 of 9

Thread: Email from ASP.NET Web Page

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Question Email from ASP.NET Web Page

    Is there a way to send an automatic email from an ASP.NET
    page? This page would be hosted on my personal space from my
    ISP so I figured it wasn't possible because there wouldn't be an
    email client or whatever.

    I know the user viewing the page could send an email by
    clicking a hyperlink but this would need to be automatically sent
    from the page at a certain time.

    Just wondering if this is possible.
    Last edited by wey97; Dec 16th, 2003 at 12:19 PM.

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    If the server has some type of email component like CDONTS or Persits.MailSender...then it could be done, otherwise I think the only way to do it would be to have a mailto: link.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  3. #3
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Does this work:
    Code:
    Dim m As New MailMessage()
    m.To = "[email protected]"
    m.From = "[email protected]"
    m.Subject = "Sending you an email"
    m.BodyFormat = MailFormat.Html
    m.Body = "HERE IS MY MESSAGE"
    SmtpMail.SmtpServer =  "mail.somesite.com"
    SmtpMail.Send(m)
    The smtp server is the one you send mail from.

  4. #4
    Hyperactive Member tailz's Avatar
    Join Date
    Jul 2002
    Posts
    306
    Any Idea how would you set the reply-to (or receipt-to) using that object? I don't want to fake the .from

    GaZ

  5. #5
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    I don't understand. Why would you 'fake' it? You have to put in a to and from email address. It is pretty straight forward. Who do you want it to go to, and who is it from....


    I think those objects are in the System.Web.Mail namespace, forgot to mention that.

  6. #6
    Hyperactive Member tailz's Avatar
    Join Date
    Jul 2002
    Posts
    306
    yea but I want to put other peoples addresses in the .from as the site would be sending emails on behalf of people.

    I think the problem with this is the dns doesn't resolve or match to the server it was sent from and causes some problems (I think)

    Also if you set the "reply-to" rather than from then should the email bounce back for whatever reason it would go to the .from not the reply-to address..... and if im sending emails on behalf of people I would like to handle the bouncy emails rather than them :-)

    I'll keep searching google, I cant be the only person who wants to do this

    GaZ

  7. #7
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    I do this on my forums. I send a email to another user via a form, and use that code I posted as the way to send. Now, your server may not handle it the way mine does, so in that case I wouldn't know how to handle it. Maybe you can get with the mail server people and have them help you out.

  8. #8
    Hyperactive Member tailz's Avatar
    Join Date
    Jul 2002
    Posts
    306
    .....so you set the .from to be an Email address that isn't associated with your site? I currently do this on my site but I dont think its actually legal anymore (hiding identity rule) but the main reason I dont want to do this is for the bouncy email handling

    I've got an idea which I'll test out later :-)

    thanks and erm hope original problem actually got sorted (I should have started a new thread tbh)

    GaZ

  9. #9
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Originally posted by tailz
    .....so you set the .from to be an Email address that isn't associated with your site?
    Yes, because the person is sending it through my site. I can't have it coming from my site, otherwise the person they are emailing will respond to my sites address, not the original sender. The reason for me being the middle man is that I don't have to expose peoples email addresses to spiders and such. This means that if a person sends an email, it is all done through email instead of having mailto links on my pages for spiders to crawl over and collect for spamming reasons.

    As far as legal, it is fine. You see, I add at the bottom of the message being sent where it was from and how this person got their email. Users can select not to be emailed, and then they won't. I have also authenticated the user sending the email before they can send so that isn't a problem.

Posting Permissions

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



Click Here to Expand Forum to Full Width