472,976 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,976 software developers and data experts.

smtp

JD
Is it possible using the smtp class in asp.net to send emails and
authenticate to the mail server that is sending the emails out.

Currently I have a web application that works fine on my machine, will send
email to both my company email addresses and to non-company email addresses.
However, as soon as I move the app into the production server it does not
send email to non company email addresses. What I mean by company is our
domain could @domain.com and it will work fine sending emails to any one
with that email address, but anyone without that in their email address and
it crashes. Any help on this would be appreciated.

--
J. D
Nov 19 '05 #1
11 1974
Private Sub Command1_Click()
Dim Mail As CDO.Message
Dim Conf As CDO.Configuration
Set Mail = New CDO.Message
Set Conf = New CDO.Configuration
With Conf
.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing")
= CDO.CdoSendUsing.cdoSendUsingPort
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= "your_mail_server_here"
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1") 'basic authentication
.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"my_username_here") 'set your username here
.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
"super_secret") 'set your password here
End With
With Mail
.Configuration = Conf
.From = "your_email_addr"
.To = "target_email_addr"
.Subject = "Testing"
.HTMLBody = "As title"
.Sender = "your_email_addr"
.Send
End With
End Sub

"JD" <jd****@dalys.us> Ľ¶Ľg©ó¶lĄó·s»D:uC**************@TK2MSFTNGP15.phx.g bl...
Is it possible using the smtp class in asp.net to send emails and
authenticate to the mail server that is sending the emails out.

Currently I have a web application that works fine on my machine, will
send email to both my company email addresses and to non-company email
addresses. However, as soon as I move the app into the production server
it does not send email to non company email addresses. What I mean by
company is our domain could @domain.com and it will work fine sending
emails to any one with that email address, but anyone without that in
their email address and it crashes. Any help on this would be appreciated.

--
J. D

Nov 19 '05 #2
JD
Lau Lei

Thanks for the quick reply, my bad for not pointing this out but this
was using asp.net and not visual basic.

See code down below

'Put user code to initialize the page here
Dim oMail As System.Web.Mail.SmtpMail
Dim oMailMsg As New System.Web.Mail.MailMessage
Dim sServer As String
Dim sMsgBody As New System.Text.StringBuilder
Dim sAutoMsgBody As New System.Text.StringBuilder
Try

'Check to see if there is any postback, if there is none
then send the message
If Not IsPostBack Then
With oMail
'Set the mail server name
.SmtpServer =
ConfigurationSettings.AppSettings("SmtpServer")

'Get the name of the server that this resides on
sServer = Request.ServerVariables("SERVER_NAME")
With oMailMsg

'Set the body format
.BodyFormat = Mail.MailFormat.Html
'Set the body content
With sMsgBody
.Append("Form Name:" &
Request.Form("FormName") & "<br>")
.Append("<br>")
.Append("First Name: " &
Request.Form("FirstName") & "<br>")
End With

.Body = sMsgBody.ToString() & vbCrLf & "Server:
" & sServer
''Automate response email
'With sAutoMsgBody
' .Append("<p>blah blah</p>")
' .Append("<br>")
'End With

'With oMailMsg
' 'Take it from the email address that was
entered on the contact form
' .To = Request.Form("email")
' 'Set the body format
' .BodyFormat = Mail.MailFormat.Html
' 'Subject line
' .Subject = "Automated response"
' 'From address
' .From =
ConfigurationSettings.AppSettings("CustFromSite")
' 'Body
' .Body = sAutoMsgBody.ToString()
'End With
''Send the email
'.Send(oMailMsg)

End With
'Clean up
oMail = Nothing
oMailMsg = Nothing
sMsgBody = Nothing
'Check to see if this is going to a custom thank you
page or not
If Len(Request.Form("RedirectPath")) > 0 Then
'Redirect the site to the custom thank you page
Response.Redirect(Request.Form("RedirectPath"))
End If

End If
Catch ex As Exception
'To be done yet
Response.Write(ex.Message)
Response.Write(ex.StackTrace)

End Try
--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 19 '05 #3
It doesn't really matter.

First of all you should know System.Web.Mail is just a wrapper over CDO
objects.

And then MailMessage also have property called "Fields" that you can use.

Just use the field names in the example to fill in the information.

"JD" <wo**@dalyse.us> ???????:eY**************@TK2MSFTNGP09.phx.gbl...
Lau Lei

Thanks for the quick reply, my bad for not pointing this out but this
was using asp.net and not visual basic.

See code down below

'Put user code to initialize the page here
Dim oMail As System.Web.Mail.SmtpMail
Dim oMailMsg As New System.Web.Mail.MailMessage
Dim sServer As String
Dim sMsgBody As New System.Text.StringBuilder
Dim sAutoMsgBody As New System.Text.StringBuilder
Try

'Check to see if there is any postback, if there is none
then send the message
If Not IsPostBack Then
With oMail
'Set the mail server name
.SmtpServer =
ConfigurationSettings.AppSettings("SmtpServer")

'Get the name of the server that this resides on
sServer = Request.ServerVariables("SERVER_NAME")
With oMailMsg

'Set the body format
.BodyFormat = Mail.MailFormat.Html
'Set the body content
With sMsgBody
.Append("Form Name:" &
Request.Form("FormName") & "<br>")
.Append("<br>")
.Append("First Name: " &
Request.Form("FirstName") & "<br>")
End With

.Body = sMsgBody.ToString() & vbCrLf & "Server:
" & sServer
''Automate response email
'With sAutoMsgBody
' .Append("<p>blah blah</p>")
' .Append("<br>")
'End With

'With oMailMsg
' 'Take it from the email address that was
entered on the contact form
' .To = Request.Form("email")
' 'Set the body format
' .BodyFormat = Mail.MailFormat.Html
' 'Subject line
' .Subject = "Automated response"
' 'From address
' .From =
ConfigurationSettings.AppSettings("CustFromSite")
' 'Body
' .Body = sAutoMsgBody.ToString()
'End With
''Send the email
'.Send(oMailMsg)

End With
'Clean up
oMail = Nothing
oMailMsg = Nothing
sMsgBody = Nothing
'Check to see if this is going to a custom thank you
page or not
If Len(Request.Form("RedirectPath")) > 0 Then
'Redirect the site to the custom thank you page
Response.Redirect(Request.Form("RedirectPath"))
End If

End If
Catch ex As Exception
'To be done yet
Response.Write(ex.Message)
Response.Write(ex.StackTrace)

End Try
--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Nov 19 '05 #4
JD,

I think the problem is : The production server requires authentication
before you can send a mail using a specific email Id.

In ASP .Net there is no direct way to achieve this, so the solution Lau has
suggested can be implemented in ASP .Net by adding a reference to the COM
object.

"JD" wrote:
Lau Lei

Thanks for the quick reply, my bad for not pointing this out but this
was using asp.net and not visual basic.

See code down below

'Put user code to initialize the page here
Dim oMail As System.Web.Mail.SmtpMail
Dim oMailMsg As New System.Web.Mail.MailMessage
Dim sServer As String
Dim sMsgBody As New System.Text.StringBuilder
Dim sAutoMsgBody As New System.Text.StringBuilder
Try

'Check to see if there is any postback, if there is none
then send the message
If Not IsPostBack Then
With oMail
'Set the mail server name
.SmtpServer =
ConfigurationSettings.AppSettings("SmtpServer")

'Get the name of the server that this resides on
sServer = Request.ServerVariables("SERVER_NAME")
With oMailMsg

'Set the body format
.BodyFormat = Mail.MailFormat.Html
'Set the body content
With sMsgBody
.Append("Form Name:" &
Request.Form("FormName") & "<br>")
.Append("<br>")
.Append("First Name: " &
Request.Form("FirstName") & "<br>")
End With

.Body = sMsgBody.ToString() & vbCrLf & "Server:
" & sServer
''Automate response email
'With sAutoMsgBody
' .Append("<p>blah blah</p>")
' .Append("<br>")
'End With

'With oMailMsg
' 'Take it from the email address that was
entered on the contact form
' .To = Request.Form("email")
' 'Set the body format
' .BodyFormat = Mail.MailFormat.Html
' 'Subject line
' .Subject = "Automated response"
' 'From address
' .From =
ConfigurationSettings.AppSettings("CustFromSite")
' 'Body
' .Body = sAutoMsgBody.ToString()
'End With
''Send the email
'.Send(oMailMsg)

End With
'Clean up
oMail = Nothing
oMailMsg = Nothing
sMsgBody = Nothing
'Check to see if this is going to a custom thank you
page or not
If Len(Request.Form("RedirectPath")) > 0 Then
'Redirect the site to the custom thank you page
Response.Redirect(Request.Form("RedirectPath"))
End If

End If
Catch ex As Exception
'To be done yet
Response.Write(ex.Message)
Response.Write(ex.StackTrace)

End Try
--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Nov 19 '05 #5
JD
Okay, could you give me an example of how it would look, I am trying and I
am getting some weird looking results.

CDO.CdoSendUsing.cdoSendUsingPort - Where does this come from?
.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing")
= CDO.CdoSendUsing.cdoSendUsingPort
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver")
= "your_mail_server_here"
.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport")
= 25
.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1") 'basic authentication
.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"my_username_here") 'set your username here
.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
"super_secret") 'set your password here
"Lau Lei Cheong" <le****@yehoo.com.hk> wrote in message
news:OW**************@tk2msftngp13.phx.gbl...
It doesn't really matter.

First of all you should know System.Web.Mail is just a wrapper over CDO
objects.

And then MailMessage also have property called "Fields" that you can use.

Just use the field names in the example to fill in the information.

"JD" <wo**@dalyse.us> ???????:eY**************@TK2MSFTNGP09.phx.gbl...
Lau Lei

Thanks for the quick reply, my bad for not pointing this out but this
was using asp.net and not visual basic.

See code down below

'Put user code to initialize the page here
Dim oMail As System.Web.Mail.SmtpMail
Dim oMailMsg As New System.Web.Mail.MailMessage
Dim sServer As String
Dim sMsgBody As New System.Text.StringBuilder
Dim sAutoMsgBody As New System.Text.StringBuilder
Try

'Check to see if there is any postback, if there is none
then send the message
If Not IsPostBack Then
With oMail
'Set the mail server name
.SmtpServer =
ConfigurationSettings.AppSettings("SmtpServer")

'Get the name of the server that this resides on
sServer = Request.ServerVariables("SERVER_NAME")
With oMailMsg

'Set the body format
.BodyFormat = Mail.MailFormat.Html
'Set the body content
With sMsgBody
.Append("Form Name:" &
Request.Form("FormName") & "<br>")
.Append("<br>")
.Append("First Name: " &
Request.Form("FirstName") & "<br>")
End With

.Body = sMsgBody.ToString() & vbCrLf & "Server:
" & sServer
''Automate response email
'With sAutoMsgBody
' .Append("<p>blah blah</p>")
' .Append("<br>")
'End With

'With oMailMsg
' 'Take it from the email address that was
entered on the contact form
' .To = Request.Form("email")
' 'Set the body format
' .BodyFormat = Mail.MailFormat.Html
' 'Subject line
' .Subject = "Automated response"
' 'From address
' .From =
ConfigurationSettings.AppSettings("CustFromSite")
' 'Body
' .Body = sAutoMsgBody.ToString()
'End With
''Send the email
'.Send(oMailMsg)

End With
'Clean up
oMail = Nothing
oMailMsg = Nothing
sMsgBody = Nothing
'Check to see if this is going to a custom thank you
page or not
If Len(Request.Form("RedirectPath")) > 0 Then
'Redirect the site to the custom thank you page
Response.Redirect(Request.Form("RedirectPath"))
End If

End If
Catch ex As Exception
'To be done yet
Response.Write(ex.Message)
Response.Write(ex.StackTrace)

End Try
--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com


Nov 19 '05 #6
JD
It would seem that you may be right

..Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

..Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver").values
= "mail.nemo.com"

..Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport").values
= 25

..Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1") 'basic authentication

..Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"crush") 'set your username here

..Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
"totallydude") 'set your password here

it fails on the first line above and I get the error message down below

Object variable or With block variable not set. at
Microsoft.VisualBasic.CompilerServices.LateBinding .InternalLateSet(Object o,
Type& objType, String name, Object[] args, String[] paramnames, Boolean
OptimisticSet, CallType UseCallType) at
Microsoft.VisualBasic.CompilerServices.LateBinding .LateSetComplex(Object o,
Type objType, String name, Object[] args, String[] paramnames, Boolean
OptimisticSet, Boolean RValueBase) at
blueconnect.sendmail.Page_PreRender(Object sender, EventArgs e) in
C:\projects\Docroot\OtherClients\jci\app_includes\ sendmail.aspx.vb:line 49

"Mayur Shah" <Mayur Sh**@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
JD,

I think the problem is : The production server requires authentication
before you can send a mail using a specific email Id.

In ASP .Net there is no direct way to achieve this, so the solution Lau
has
suggested can be implemented in ASP .Net by adding a reference to the COM
object.

"JD" wrote:
Lau Lei

Thanks for the quick reply, my bad for not pointing this out but this
was using asp.net and not visual basic.

See code down below

'Put user code to initialize the page here
Dim oMail As System.Web.Mail.SmtpMail
Dim oMailMsg As New System.Web.Mail.MailMessage
Dim sServer As String
Dim sMsgBody As New System.Text.StringBuilder
Dim sAutoMsgBody As New System.Text.StringBuilder
Try

'Check to see if there is any postback, if there is none
then send the message
If Not IsPostBack Then
With oMail
'Set the mail server name
.SmtpServer =
ConfigurationSettings.AppSettings("SmtpServer")

'Get the name of the server that this resides on
sServer = Request.ServerVariables("SERVER_NAME")
With oMailMsg

'Set the body format
.BodyFormat = Mail.MailFormat.Html
'Set the body content
With sMsgBody
.Append("Form Name:" &
Request.Form("FormName") & "<br>")
.Append("<br>")
.Append("First Name: " &
Request.Form("FirstName") & "<br>")
End With

.Body = sMsgBody.ToString() & vbCrLf & "Server:
" & sServer
''Automate response email
'With sAutoMsgBody
' .Append("<p>blah blah</p>")
' .Append("<br>")
'End With

'With oMailMsg
' 'Take it from the email address that was
entered on the contact form
' .To = Request.Form("email")
' 'Set the body format
' .BodyFormat = Mail.MailFormat.Html
' 'Subject line
' .Subject = "Automated response"
' 'From address
' .From =
ConfigurationSettings.AppSettings("CustFromSite")
' 'Body
' .Body = sAutoMsgBody.ToString()
'End With
''Send the email
'.Send(oMailMsg)

End With
'Clean up
oMail = Nothing
oMailMsg = Nothing
sMsgBody = Nothing
'Check to see if this is going to a custom thank you
page or not
If Len(Request.Form("RedirectPath")) > 0 Then
'Redirect the site to the custom thank you page
Response.Redirect(Request.Form("RedirectPath"))
End If

End If
Catch ex As Exception
'To be done yet
Response.Write(ex.Message)
Response.Write(ex.StackTrace)

End Try
--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Nov 19 '05 #7
This works for me (and no COM wrapper stuff or CDO objects needed):

System.Web.Mail.MailMessage mail = new System.Web.Mail.MailMessage();
mail.To = destinationAddresses;
mail.From = fromAddress;
mail.Subject = subjectLine;
mail.Body = mailBody;
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1"); //basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
m_SMTPLoginID); //set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
m_SMTPLoginPW); //set your password here
System.Web.Mail.SmtpMail.SmtpServer = m_SMTPMailServer; // e.g.,
"mail.MyDomain.com"; //your smtp server goes here
System.Web.Mail.SmtpMail.Send( mail );

-HTH

"JD" <jd****@dalys.us> wrote in message
news:Oa**************@TK2MSFTNGP14.phx.gbl...
It would seem that you may be right

.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver").values
= "mail.nemo.com"

.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport").values
= 25

.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
"1") 'basic authentication

.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
"crush") 'set your username here

.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
"totallydude") 'set your password here

it fails on the first line above and I get the error message down below

Object variable or With block variable not set. at
Microsoft.VisualBasic.CompilerServices.LateBinding .InternalLateSet(Object
o, Type& objType, String name, Object[] args, String[] paramnames, Boolean
OptimisticSet, CallType UseCallType) at
Microsoft.VisualBasic.CompilerServices.LateBinding .LateSetComplex(Object
o, Type objType, String name, Object[] args, String[] paramnames, Boolean
OptimisticSet, Boolean RValueBase) at
blueconnect.sendmail.Page_PreRender(Object sender, EventArgs e) in
C:\projects\Docroot\OtherClients\jci\app_includes\ sendmail.aspx.vb:line 49

"Mayur Shah" <Mayur Sh**@discussions.microsoft.com> wrote in message
news:6C**********************************@microsof t.com...
JD,

I think the problem is : The production server requires authentication
before you can send a mail using a specific email Id.

In ASP .Net there is no direct way to achieve this, so the solution Lau
has
suggested can be implemented in ASP .Net by adding a reference to the COM
object.

"JD" wrote:
Lau Lei

Thanks for the quick reply, my bad for not pointing this out but this
was using asp.net and not visual basic.

See code down below

'Put user code to initialize the page here
Dim oMail As System.Web.Mail.SmtpMail
Dim oMailMsg As New System.Web.Mail.MailMessage
Dim sServer As String
Dim sMsgBody As New System.Text.StringBuilder
Dim sAutoMsgBody As New System.Text.StringBuilder
Try

'Check to see if there is any postback, if there is none
then send the message
If Not IsPostBack Then
With oMail
'Set the mail server name
.SmtpServer =
ConfigurationSettings.AppSettings("SmtpServer")

'Get the name of the server that this resides on
sServer = Request.ServerVariables("SERVER_NAME")
With oMailMsg

'Set the body format
.BodyFormat = Mail.MailFormat.Html
'Set the body content
With sMsgBody
.Append("Form Name:" &
Request.Form("FormName") & "<br>")
.Append("<br>")
.Append("First Name: " &
Request.Form("FirstName") & "<br>")
End With

.Body = sMsgBody.ToString() & vbCrLf & "Server:
" & sServer
''Automate response email
'With sAutoMsgBody
' .Append("<p>blah blah</p>")
' .Append("<br>")
'End With

'With oMailMsg
' 'Take it from the email address that was
entered on the contact form
' .To = Request.Form("email")
' 'Set the body format
' .BodyFormat = Mail.MailFormat.Html
' 'Subject line
' .Subject = "Automated response"
' 'From address
' .From =
ConfigurationSettings.AppSettings("CustFromSite")
' 'Body
' .Body = sAutoMsgBody.ToString()
'End With
''Send the email
'.Send(oMailMsg)

End With
'Clean up
oMail = Nothing
oMailMsg = Nothing
sMsgBody = Nothing
'Check to see if this is going to a custom thank you
page or not
If Len(Request.Form("RedirectPath")) > 0 Then
'Redirect the site to the custom thank you page
Response.Redirect(Request.Form("RedirectPath"))
End If

End If
Catch ex As Exception
'To be done yet
Response.Write(ex.Message)
Response.Write(ex.StackTrace)

End Try
--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com


Nov 19 '05 #8
JD
Thanks everyone, I was able to get it work after I tried out Jeremy S.
suggestion, learn something new tonight or morning or whatever time it is
now. Issue closed.
"JD" <jd****@dalys.us> wrote in message
news:uC**************@TK2MSFTNGP15.phx.gbl...
Is it possible using the smtp class in asp.net to send emails and
authenticate to the mail server that is sending the emails out.

Currently I have a web application that works fine on my machine, will
send email to both my company email addresses and to non-company email
addresses. However, as soon as I move the app into the production server
it does not send email to non company email addresses. What I mean by
company is our domain could @domain.com and it will work fine sending
emails to any one with that email address, but anyone without that in
their email address and it crashes. Any help on this would be appreciated.

--
J. D

Nov 19 '05 #9
Keep in mind that the method I showed to you is officially "undocumented" -
meaning it might not be supported in the future. I suspect that's why this
solution is rarely recommended.

I'm sure the MVPs around here are aware of this undocumented solution - but
they don't recommend it - and probably for good reason. I'd be interested in
knowing why. This question is posed with some regularity and they always
seem to recommend some more complicated method that relies on CDO/COM
wrapper-based solution.

-JS
"JD" <jd****@dalys.us> wrote in message
news:OL**************@TK2MSFTNGP14.phx.gbl...
Thanks everyone, I was able to get it work after I tried out Jeremy S.
suggestion, learn something new tonight or morning or whatever time it is
now. Issue closed.
"JD" <jd****@dalys.us> wrote in message
news:uC**************@TK2MSFTNGP15.phx.gbl...
Is it possible using the smtp class in asp.net to send emails and
authenticate to the mail server that is sending the emails out.

Currently I have a web application that works fine on my machine, will
send email to both my company email addresses and to non-company email
addresses. However, as soon as I move the app into the production server
it does not send email to non company email addresses. What I mean by
company is our domain could @domain.com and it will work fine sending
emails to any one with that email address, but anyone without that in
their email address and it crashes. Any help on this would be
appreciated.

--
J. D


Nov 19 '05 #10
Hi, Jeremy.

re:
I'm sure the MVPs around here are aware of this undocumented solution - but they don't
recommend it - and probably for good reason.
The only reason to use that is if the smtp server needs authentication.

I've sent quite a few references to this FAQ page in response
to questions about sending authenticated smtp mail:

http://www.systemwebmail.com/faq/3.8.aspx

If the server doesn't need authenticacion, the standard, less complicated,
methods of sending mail ( the "wrappers" you refer to ) work just fine,
so why introduce complicated schema code if there's no need for it ?

The best reference site for system.web.mail is this FAQ :

http://www.systemwebmail.com/faq.aspx

I don't think I've come up with a problem not documented/solved there.


Juan T. Llibre
ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
==========================

"Jeremy S." <A@B.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... Keep in mind that the method I showed to you is officially "undocumented" - meaning it
might not be supported in the future. I suspect that's why this solution is rarely
recommended.

I'm sure the MVPs around here are aware of this undocumented solution - but they don't
recommend it - and probably for good reason. I'd be interested in knowing why. This
question is posed with some regularity and they always seem to recommend some more
complicated method that relies on CDO/COM wrapper-based solution.

-JS
"JD" <jd****@dalys.us> wrote in message news:OL**************@TK2MSFTNGP14.phx.gbl...
Thanks everyone, I was able to get it work after I tried out Jeremy S. suggestion,
learn something new tonight or morning or whatever time it is now. Issue closed.
"JD" <jd****@dalys.us> wrote in message news:uC**************@TK2MSFTNGP15.phx.gbl...
Is it possible using the smtp class in asp.net to send emails and authenticate to the
mail server that is sending the emails out.

Currently I have a web application that works fine on my machine, will send email to
both my company email addresses and to non-company email addresses. However, as soon
as I move the app into the production server it does not send email to non company
email addresses. What I mean by company is our domain could @domain.com and it will
work fine sending emails to any one with that email address, but anyone without that
in their email address and it crashes. Any help on this would be appreciated.

--
J. D



Nov 19 '05 #11
JD
thanks, I will keep that in mind

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 19 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dan Boyle | last post by:
Hi, I am having difficulty connection to an smtp host. I am using the following code but I don't think I fully understand what smtp host can be used. function setSMTPParams($host = null,...
21
by: Nancy | last post by:
Hi, Guys, Is there any other way to use python or mod_python writing a web page? I mean, not use "form.py/email", no SMTP server. <form action="form.py/email" method="POST"> ... Thanks a lot. ...
0
by: Almir | last post by:
I hate this Net::SMTP stuff, everything works fine but for the suject field. I see no way of having it show in an email when sent. Has anyone had this problem, can anyone explain why there are no...
2
by: RandRace | last post by:
I'm having some problems with a little script i wrote using net::smtp. I originally wrote it in linux where it works perfectly. I tried to use it from windows the other day and it doesn't work. It...
3
by: Shannon Clyde | last post by:
SMTP + relay + auth in an IPSEC tunnel to connect to our primary SMTP mail server (GroupWise) from the Web server looks like it would work fine, but is it the best way? I am aware of CDOSYS and...
3
by: dale zhang | last post by:
Hi, I write an asp.net web application. It has a “Contact Us” page, where users fill in their email, subject and text and hit send. Then the email will go to my hard coded yahoo email...
1
by: bivin | last post by:
hai i am requesting your technical support. please help me. i have been working with this for five days. the problem is relating with the smtp. i am trying to send an email from the asp.net...
34
by: antonyliu2002 | last post by:
I've set up the virtual smtp server on my IIS 5.1 like so: 1. Assign IP address to "All Unassigned", and listen to port 25. 2. Access Connection granted to "127.0.0.1". 3. Relay only allow...
13
by: jcor | last post by:
Hi, I'm trying some code to send a mail with my script. This is it: #!/usr/bin/perl use Net::SMTP; my $smtp_server='62.193.245.15'; my $smtp = Net::SMTP->new($smtp_server) or die "Can't Open...
5
by: jimhill10 | last post by:
I have a perl script that creates an email attachment file from POST data on a web page. This works just fine. I want to customize the email body to contain all of the text data from the file...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.