Youtube Video Bar

Loading...

Tuesday, April 10, 2012

Send Mail From WPF using Godaddy Email Account

This is more for personal reference but might help a few people.
If you have godaddy as a host,  have the free email, paid extra email accounts (etc) and have your smtp relays set greater than zero you can send mail through your desktop app.

'must have a legitimate email setup with smtp relays set greater than 0 in your godaddy control panel (email accounts) 
Private Sub btnSendMessage_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles btnSendMessage.Click
      CreateTimeoutTestMessage("smtpout.secureserver.net") 'This is standard with most email relays at godaddy
  End Sub
  Public Shared Sub CreateTimeoutTestMessage(server As String)
      Dim [to] As String = "busted@fbi.gov"
      Dim from As String = "billyjoebob@hillbilly.com"
      Dim subject As String = "Catch Me If You Can."
      Dim body As String = "This is the body of the message. Yada Yada Yada"
      Dim message As New MailMessage(from, [to], subject, body)
      Dim client As New SmtpClient(server, 80)
      Console.WriteLine("Changing time out from {0} to 100.", client.Timeout)
      client.Timeout = 100
     
      'important otherwise it will timeout
      client.UseDefaultCredentials = False
      Dim basicAuthInfo As New NetworkCredential("support@yourfirm.com", "yourpassword")'real email account info setup at godaddy
      client.Credentials = basicAuthInfo
 
      Try
          client.Send(message)
      Catch ex As Exception
          Console.WriteLine("Exception caught in CreateTimeoutTestMessage(): {0}", ex.ToString())
      End Try
  End Sub

Sunday, March 25, 2012

Paypal Sandbox Fix: You cannot use an e-mail address or card number that belongs to an existing PayPal account.

If you're banging your head trying to use the sandbox with the generated test credit card and you receive this message
"You cannot use an e-mail address or card number that belongs to an existing PayPal account. If you have a PayPal account, please log in. If you don't, please change the e-mail address or card number and try again."
when testing as a user with no paypal account you're not alone.

I have only skimmed the paypal sandbox documentation but found nothing that explains how to use the sandbox as a user without a paypal account.

Here is how I finally was able to test as a user with no account.

First forget about the sandbox generated credit card. It is tied to an existing test account and you will always receive the "You cannot use an e-mail address or card number that belongs to an existing ... message"

Use a Visa credit card number that is compliant with the Luhn algorithm. The paypal sandbox seems only to validate that card is in the correct format and does not validate any further than that.

I have been testing with the following:
Expiry date 05/2015
CVV code 000
Card number  45195279077820xx      where the last two xx are random numbers.
You can also check some of these and add different numbers on the end.
4539644852839411
4916985889534399
4532097446064367
4485179022551897
4539900745341886
4024007169148268
4024007136243697
4916509257154174
4916407734970124
4929371306022430
4485211356602036
4916165218627327
4716027688991769
4929468741933781
4485270162834753
4916077487725650
4916623903076903
4539664564248123
4725765424431181
4024007194632823

Another thing to do is google "test credit card numbers", it may help.