Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 14th, 2007, 06:03 PM
Friend of Wrox
 
Join Date: Mar 2006
Location: , , Portugal.
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default force email to go

hello,

i use this funtion to send email when a user click in button.

Code:
Imports System.Web.Mail


    Private Sub SendEmail()
        Const SERVER As String = "relay-hosting.secureserver.net"
        Dim oMail As MailMessage = New System.Web.Mail.MailMessage
        oMail.From = "emailaddress@domainname"
        oMail.To = "emailaddress@domainname"
        oMail.Subject = "Test email subject"
        oMail.BodyFormat = MailFormat.Html
        ' enumeration
        oMail.Priority = MailPriority.High
        ' enumeration
        oMail.Body = ("Sent at: " + DateTime.Now)
        SmtpMail.SmtpServer = SERVER
       Try
        SmtpMail.Send(oMail)
       Catch
        Result.text = "The mail couldn´t be sent !!"
       End Try
        oMail = Nothing
        ' free up resources
    End Sub
But sometimes the mail is not sent...
I think it's because "smtp server"
I have to click several times in button to see mail going out...

It is possible to make a cycle of 10 or 20 times to try to send the mail, and in case of sucess stops the cicle?

Thanks very much!

I use this for register page of my forum... and sometimes the users don't receive email's!

It's very boring,

Max

  #2 (permalink)  
Old January 16th, 2007, 06:03 AM
Registered User
 
Join Date: Jan 2007
Location: Sopron, Györ-Moson-Sopron megye, Hungary.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sure it is possible to build such a loop around the sending part but how many times would you try to send? Moreover is there an exception thrown, if the mail is not sent?

I would try a different mail server. Also check the current server if it receives the messages or if the server recycles them (spam/junk).
  #3 (permalink)  
Old January 16th, 2007, 10:42 AM
Friend of Wrox
 
Join Date: Mar 2006
Location: , , Portugal.
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Also check the current server if it receives the messages or if the server recycles them (spam/junk).
How can i do that?

I have my site in goDaddy and i use them stmp server!

When I told them my problem they say that stmp server is ok... to Check my code!

But my code it's simple, and i think it's fine!

If my code was wrong i couldn't send my mail at the to fourth or the fifth time that I click in the button, right?

  #4 (permalink)  
Old January 16th, 2007, 11:11 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Is your Catch statement executing, e.g. is there an error that is being thrown?

-----------------------------------------------------------
I will only tell you how to do it, not do it for you.------------
Unless, of course, you want to hire me to do work for you.---
^^Thats my signature--------------------------------------
-----------------------------------------------------------
http://www.catb.org/~esr/faqs/smart-questions.html -------
^^Took that from planoie's profile--------------------------
-----------------------------------------------------------
  #5 (permalink)  
Old January 17th, 2007, 09:04 PM
Friend of Wrox
 
Join Date: Mar 2006
Location: , , Portugal.
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your reply!

Yes, the catch throw this:

"System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80040213): An imperfection in the linking of the transport to the server occurred. --- End of inner exception stack trace --- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) at System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String methodName, Object[] args) --- End of inner exception stack trace --- at System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String methodName, Object[] args) at System.Web.Mail.CdoSysHelper.Send(MailMessage message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at Maxim.WebModules.Accounts.Web.registostemp.enviaMa ilEnviar_Click(Object sender, EventArgs e)"

  #6 (permalink)  
Old January 17th, 2007, 09:27 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Your mailing through an open relay :shudders: sounds like your writing a Spam program. In any case I am not fimilar with this error or what is causing it, try and google it.

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile
================================================== =========
  #7 (permalink)  
Old January 17th, 2007, 11:05 PM
Friend of Wrox
 
Join Date: Mar 2006
Location: , , Portugal.
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i don't think it's spam...

In my local computer i have the same application running, but here i have no mail configured.
So, when i click in a button, there are no vaid smtp server to provide outgoing email! But the error is the same.

I really think the godaddy smtp server is full of requests but they don't admit that!
If it's spam problem, or email.body problem i never had sucess send mails, but i have sucess at 4ª or 5ª time that i click in button.

since godaddy don't assume the problem and i have no money to request a personal smtp server:
make a cycle isn't the best way to solve the problem?

Thanks!

  #8 (permalink)  
Old January 18th, 2007, 12:12 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

relay-hosting.secureserver.net that is the server you are using not godaddys. What you need to consider is that you are connecting to a remote SMTP server from godaddys Webserver, what I would check to see is if you are having problems connecting to that Mail server from godaddys webserver.

What I might try doing is using gmails mail server ot send the email (You have to have a Gmail account to even consider this tho) and try sending the email through there and just supply your gmail credientials.

See if you have the same problems.

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile
================================================== =========
  #9 (permalink)  
Old January 18th, 2007, 08:52 PM
Friend of Wrox
 
Join Date: Mar 2006
Location: , , Portugal.
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are you saing that i can make a free gmail account and use it to send smtp mails from my asp.net application?

They provide this?

I will find a way to this and i will writte here the results!

Thanks,
Max

  #10 (permalink)  
Old January 18th, 2007, 08:54 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Gmail is an invite only service (In the USA anyway) and, i dont suggest, using their mail server as your bulk mail server, although it could be done.

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Force ActiveMdiChild gbyrkje VB.NET 1 October 8th, 2004 05:55 PM
force macros enable helmekki Excel VBA 1 August 14th, 2004 07:18 AM
How To Force Column To Text ritag Excel VBA 12 August 13th, 2004 05:36 PM
Force A File To download harpua Javascript How-To 2 June 23rd, 2004 03:03 PM
force Page_Load miguel.ossa ASP.NET 1.0 and 1.1 Basics 7 January 23rd, 2004 06:04 AM



All times are GMT -4. The time now is 06:35 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.