Last post Sep 09, 2009 03:11 PM by learner01
Sep 30, 2008 07:27 AM|roymartian|LINK
Got my e-mail working but still with some problems.
It only works when I use the firstname.lastname@example.org for "Your Email", see example http://www.localstar.com.au/ShowAd.aspx?id=75
My host has advised the following but I am not sure of required modifications - any tips please!
As "SMTP authentication" require the "Form address" to be the same as of the "email address" used in "authentication session", therefore, the page will only work if "Your email" field is set to "email@example.com".
Nov 12, 2008 09:00 AM|ldechent|LINK
I notice that your post hasn't received a reply. I can't answer the original question you asked, but I was wondering if you might be interested in an alternative.
If you have a gmail account and could use that for your work to send email from your web page, would that interest you? If I understand correctly, your main objective is to be able to send an email which, if someone replied to it, the reply would be sent
to you, not the postmaster.
Nov 15, 2008 09:16 PM|roymartian|LINK
This could work, can you explain method more.
I have been told also that the problem is probably due to my IIS settings? - could this be true?
Thanks for your help.
Nov 15, 2008 09:37 PM|ldechent|LINK
OK, I'll look for a post on this that I worked on a while back when working with someone else. I'll post the link here and also try it myself, just in case anything has changed.
I assume you are working with Visual Studio 2008 or Visual Web Developer 2008 Express Edition?
Oh, and I need to know, do you use VB or C# for your code behind?
Nov 15, 2008 09:53 PM|roymartian|LINK
Thanks Larry, really appreciate it.
I am using Visual Web Developer 2008 Express Edition
Nov 15, 2008 10:32 PM|ldechent|LINK
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="VBMail_test2.aspx.vb" Inherits="VBMail_test2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<form id="form1" runat="server">
<asp:TextBox ID="ToTextBox" Width="300px" runat="server" />
<br /><br />
<asp:TextBox ID="SubjectTextBox" Width="500px" runat="server" />
<br /><br />
<asp:TextBox ID="MessageTextBox" runat="server" Width="500px" Height="100px" TextMode="MultiLine" />
<br /><br />
<asp:Button ID="MailButton" runat="server" Text="Push to send the email" />
**********aspx code above *** aspx.vb code behind page below*************
Partial Class VBMail_test2
Protected Sub MailButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MailButton.Click
Dim Mail As New System.Net.Mail.MailMessage()
.From = New Net.Mail.MailAddress("firstname.lastname@example.org")
.Subject = SubjectTextBox.Text
.Body = MessageTextBox.Text
Dim SMTP As New Net.Mail.SmtpClient("smtp.gmail.com")
SMTP.Credentials = New System.Net.NetworkCredential("email@example.com", "yourpassword")
SMTP.Port = 587
SMTP.Host = "smtp.gmail.com"
SMTP.EnableSsl = True
SMTP = Nothing
ToTextBox.Text = ""
SubjectTextBox.Text = ""
MessageTextBox.Text = ""
*******code ends above this line************************
The goal is for the above page and code behind page to successfully send an email.
I'm assuming you might also want to do this from an account on a server, possibly a web page.
As an example, I have a web site on GoDaddy and when working with it I need to use a web.config file that is "dumbed down" to make it work with ASP.NET 2.0 version.
Sep 09, 2009 03:11 PM|learner01|LINK
Hi, I am wondering if you would provide the same for C#? Regards! Mohammad