1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Email problem on GoDaddy

Discussion in 'C#' started by todaydvd, Mar 13, 2007.

  1. #1
    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
     
    todaydvd, Mar 13, 2007 IP
  2. Your Content

    Your Content Banned

    Messages:
    1,096
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    0
    #2
    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 :rolleyes:
     
    Your Content, Mar 13, 2007 IP
  3. todaydvd

    todaydvd Active Member

    Messages:
    324
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    58
    #3
    todaydvd, Mar 13, 2007 IP
  4. ccoonen

    ccoonen Well-Known Member

    Messages:
    1,606
    Likes Received:
    71
    Best Answers:
    0
    Trophy Points:
    160
    #4
    Try CDOSys vs. CDONTS. CDONTS Object has deprecated.
     
    ccoonen, Mar 13, 2007 IP
  5. iamsgf

    iamsgf Active Member

    Messages:
    982
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    85
    #5
    I had the same problem... thanks for the comments I will look at these options.
     
    iamsgf, Mar 4, 2008 IP
  6. vpguy

    vpguy Guest

    Messages:
    275
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    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.
     
    vpguy, Mar 4, 2008 IP
  7. yugolancer

    yugolancer Well-Known Member

    Messages:
    320
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    110
    #7
    
    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 :)
     
    yugolancer, Mar 14, 2008 IP
  8. coolcode007

    coolcode007 Well-Known Member

    Messages:
    1,122
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    148
    #8
    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):
     
    coolcode007, Mar 18, 2008 IP