I had just created a "Recommend Us" function at my website. It will let visitor send email to tell their friends about my website. However, the email cannot been sent to their friend, but it is okay to send to my hosting's email account. It seems cannot send to external domain's email only. Set objCDOMail = CreateObject("CDONTS.NewMail") objCDOMail.From = "xxxx@xxxxx.com" objCDOMail.To = "xxxx@xxxxx.com" objCDOMail.Subject = "Subject" objCDOMail.BodyFormat = 0 objCDOMail.MailFormat = 0 objCDOMail.Body = "XXXXX" objCDOMail.Send Set objCDOMail = Nothing Code (markup): What is the problem or GoDaddy limited the out-going email address? (I had tried to ask GoDaddy, but didn't get any response after 1 day...) Anyone have this experience please help! Thanks
I have no idea on hosting but in email accounts you can only relay email if previously setup through your email control panel and up to 250 email per day. Probably you may require setup your script with your smtp details for authentication and even then it may fall into the limit I told before, otherwise it might be the mail component. Try ASPmail instead of CDONTS or verify which mail component is installed in your account, if any
Thanks for your information.. I searched the answer by "smtp relay"... http://www.patio-de-recreo.com/doug/2005_May/cdo_mail_object.asp It is like what you say, the relay and authentication should be configured for out-going email. Thanks!
I spent hours pulling my hair out when I set up a forum on my GoDaddy-hosted site, and tried to make it email the welcome email to new users. It would either not send the email at all, or it would take half an hour or more before it arrived. Totally unacceptable. Support was completely useless, saying that "it's going to take a while" and "our shared servers are not designed to send mass emails". MORONS! I wanted to send ONE email and have it be sent IMMEDIATELY! After hours searching the net, I was finally able to set it up properly. This is one of those things that just took WAY longer than it should have. Here is the code that works for me (this is a very simple example). Note that you need the following code at the top of the page: <%@ Import Namespace="System.Net.Mail" %> Code (markup): static bool SendEmail(string ToAddr, string Subject, string Body) { bool result; try { MailMessage Msg = new MailMessage(); Msg.From = new MailAddress("[COLOR="RoyalBlue"][B]from-address@domain.com[/B][/COLOR]", "[B][COLOR="royalblue"]Friendly Name[/COLOR][/B]"); Msg.Subject = Subject; Msg.Body = Body.Replace("\n", " <br> "); Msg.To.Add(ToAddr); Msg.BodyEncoding = System.Text.Encoding.UTF8; Msg.Priority = MailPriority.High; Msg.IsBodyHtml = true; SmtpClient SMTP = new SmtpClient("smtpout.secureserver.net", 25); SMTP.Credentials = new System.Net.NetworkCredential("[B][COLOR="royalblue"]username@domain.com[/COLOR][/B]", "[B][COLOR="royalblue"]password[/COLOR][/B]"); SMTP.Send(Msg); result = true; } catch (Exception Err) { result = false; } return result; } Code (markup): Replace the blue text with the applicable information for your account. I'm not sure if I'm using the deprecated version or not, but it works perfectly and that's what I will use because GoDaddy's setup is so damned finicky.
Imports System.Net.Mail {...} Private Sub SendMail() Dim body As New StringBuilder Dim message As MailMessage = New MailMessage message.IsBodyHtml = True message.Subject = "New message from todaydvd's contact form." message.From = New MailAddress("info@todaydvd.com", "ANY NAME") message.To.Add(New MailAddress("info@todaydvd.com", "ANY NAME")) With body .Append("<b>" & "This message has been sent from the contact form of todaydvd.com web site" & "</b>") .Append("<br /><br />") .Append("The message was sent by: " & "<br />" & Me.txtAppealing.Text & " " & Me.txtfName.Text & " " & Me.txtlname.Text) .Append("<br />") .Append("Email of the sender: " & Me.txtEmail.Text) .Append("<br />") .Append("IP/Proxy of the sender: " & System.Web.HttpContext.Current.Request.UserHostAddress) .Append("<br /><br /><br />") .Append("<br />" & "Telephone: " & "<br />") .Append(Me.txtTelephone.Text) .Append("<br />") .Append("<br />" & "Email Address: " & "<br />") .Append(Me.txtEmail.Text) .Append("<br />") .Append("<br />" & "Website Address: " & "<br />") .Append(Me.txtWebSite.Text) .Append("<br />") .Append("<hr />") .Append("<font size='2' color='#cccccc'>") .Append("<hr />") .Append("www.todaydvd.com") .Append("<br>") .Append(Date.Now) .Append("</font>") End With message.Body = body.ToString 'relay-hosting.secureserver.net is the valid SMTP server of godaddy.com Dim mailClient As SmtpClient = New SmtpClient("relay-hosting.secureserver.net") mailClient.Send(message) message.Dispose() Response.Redirect("Message_Sent.aspx") End Sub Code (markup): Now you can call the SendMail routine from any event handler like Button_Click. Regards
here is what i use to send emails on godaddy hosted website in C#.NET with Visual Studio 2005 this works for me using System.Web.Mail; MailMessage objEmail = new MailMessage(); objEmail.To = "toAddress@yourwebsiteurl.com" objEmail.From = "fromAddress@theirsite.com"; objEmail.Subject = "Subject details"; objEmail.BodyFormat = MailFormat.Html; objEmail.Body = "details about the email"; objEmail.Priority = MailPriority.High; SmtpMail.SmtpServer = "relay-hosting.secureserver.net"; try { SmtpMail.Send(objEmail); } catch (Exception exc) { } Code (markup):